Update app.py
Browse files
app.py
CHANGED
|
@@ -63,8 +63,7 @@ def get_weighted_recommendations_from_hf(task_filter, weights=None):
|
|
| 63 |
|
| 64 |
result = []
|
| 65 |
for rank, (model_id, final_score, sim, downloads, likes) in enumerate(ranked_recommendations, 1):
|
| 66 |
-
result.append(f"Rank {rank}: Model ID: {model_id}
|
| 67 |
-
f"Similarity: {sim:.4f}, Downloads: {downloads:.4f}, Likes: {likes:.4f}")
|
| 68 |
|
| 69 |
return '\n'.join(result)
|
| 70 |
|
|
@@ -77,12 +76,12 @@ def respond(task_filter, history=None, weights=None):
|
|
| 77 |
demo = gr.Interface(
|
| 78 |
fn=respond,
|
| 79 |
inputs=[
|
| 80 |
-
gr.Textbox(label="Task Filter", placeholder="Enter the task, e.g., text-classification"),
|
| 81 |
gr.Textbox(value="You are using the Hugging Face model recommender system.", label="System message")
|
| 82 |
],
|
| 83 |
outputs=gr.Textbox(label="Model Recommendations"),
|
| 84 |
title="Hugging Face Model Recommender",
|
| 85 |
-
description="This chatbot recommends models from Hugging Face based on the task you're interested in."
|
| 86 |
)
|
| 87 |
|
| 88 |
if __name__ == "__main__":
|
|
|
|
| 63 |
|
| 64 |
result = []
|
| 65 |
for rank, (model_id, final_score, sim, downloads, likes) in enumerate(ranked_recommendations, 1):
|
| 66 |
+
result.append(f"Rank {rank}: Model ID: {model_id}")
|
|
|
|
| 67 |
|
| 68 |
return '\n'.join(result)
|
| 69 |
|
|
|
|
| 76 |
demo = gr.Interface(
|
| 77 |
fn=respond,
|
| 78 |
inputs=[
|
| 79 |
+
gr.Textbox(label="Task Filter", placeholder="Enter the task, e.g., text-classification, atari, question-answering"),
|
| 80 |
gr.Textbox(value="You are using the Hugging Face model recommender system.", label="System message")
|
| 81 |
],
|
| 82 |
outputs=gr.Textbox(label="Model Recommendations"),
|
| 83 |
title="Hugging Face Model Recommender",
|
| 84 |
+
description="This chatbot recommends models from Hugging Face based on the task or tag you're interested in. It combines various attributes of a model on hub like downloads, likes, etc. to suggest models with ranks from 1-10. In general term basically it intelligently combines the search filter for recommendation"
|
| 85 |
)
|
| 86 |
|
| 87 |
if __name__ == "__main__":
|