Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,24 +75,26 @@ def get_recent_models(min_likes, days_ago, filter_string, search_string):
|
|
75 |
return df
|
76 |
|
77 |
# Define the Gradio interface
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
88 |
headers=["Model ID", "Likes", "Creation Date", "Task"],
|
89 |
wrap=True,
|
90 |
datatype=["html", "number", "str"],
|
91 |
-
)
|
92 |
-
|
93 |
-
|
94 |
-
)
|
95 |
-
iface.launch()
|
96 |
|
97 |
if __name__ == "__main__":
|
98 |
-
|
|
|
75 |
return df
|
76 |
|
77 |
# Define the Gradio interface
|
78 |
+
with gr.Blocks() as demo:
|
79 |
+
gr.Markdown("# Model Drops Tracker ๐")
|
80 |
+
gr.Markdown("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")
|
81 |
+
with gr.Row():
|
82 |
+
likes_slider = gr.Slider(minimum=1, maximum=100, step=1, value=5, label="Minimum Likes")
|
83 |
+
days_slider = gr.Slider(minimum=1, maximum=30, step=1, value=3, label="Days Ago")
|
84 |
+
with gr.Row():
|
85 |
+
filter_text = gr.Text(label="Filter", max_lines=1)
|
86 |
+
search_text = gr.Text(label="Search", max_lines=1)
|
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 |
+
btn.click(fn=get_recent_models, inputs=[likes_slider, days_slider, filter_text, search_text], outputs=df)
|
|
|
|
|
98 |
|
99 |
if __name__ == "__main__":
|
100 |
+
demo.launch()
|