Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,26 +75,24 @@ def get_recent_models(min_likes, days_ago, filter_string, search_string):
|
|
| 75 |
return df
|
| 76 |
|
| 77 |
# Define the Gradio interface
|
| 78 |
-
|
| 79 |
-
gr.
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
btn = gr.Button("Run")
|
| 89 |
-
|
| 90 |
-
with gr.Column():
|
| 91 |
-
df = gr.DataFrame(
|
| 92 |
headers=["Model ID", "Likes", "Creation Date", "Task"],
|
| 93 |
wrap=True,
|
| 94 |
datatype=["html", "number", "str"],
|
| 95 |
-
)
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
-
|
|
|
|
| 75 |
return df
|
| 76 |
|
| 77 |
# Define the Gradio interface
|
| 78 |
+
def launch_interface():
|
| 79 |
+
iface = gr.Interface(
|
| 80 |
+
fn=get_recent_models,
|
| 81 |
+
inputs=[
|
| 82 |
+
gr.Slider(minimum=1, maximum=100, step=1, value=5, label="Minimum Likes"),
|
| 83 |
+
gr.Slider(minimum=1, maximum=30, step=1, value=3, label="Days Ago"),
|
| 84 |
+
gr.Text(label="Filter", max_lines=1),
|
| 85 |
+
gr.Text(label="Search", max_lines=1)
|
| 86 |
+
],
|
| 87 |
+
outputs=gr.DataFrame(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
headers=["Model ID", "Likes", "Creation Date", "Task"],
|
| 89 |
wrap=True,
|
| 90 |
datatype=["html", "number", "str"],
|
| 91 |
+
),
|
| 92 |
+
title="Model Drops Tracker ๐",
|
| 93 |
+
description="Overwhelmed by the rapid pace of model releases? ๐
You're not alone! That's exactly why I built this tool. Easily filter recent models from the Hub by setting a minimum number of likes and the number of days since their release. Click on a model to see its card. Use `;` to split filter and search"
|
| 94 |
+
)
|
| 95 |
+
iface.launch()
|
| 96 |
|
| 97 |
if __name__ == "__main__":
|
| 98 |
+
launch_interface()
|