Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import json
|
3 |
from huggingface_hub import HfApi, ModelFilter, list_models
|
4 |
api = HfApi()
|
5 |
-
def model_explorer(search,limit=100
|
6 |
# List all models
|
7 |
if limit==0:
|
8 |
limit=None
|
@@ -89,10 +89,11 @@ def fix_json():
|
|
89 |
print (line)
|
90 |
with gr.Blocks() as app:
|
91 |
with gr.Row():
|
92 |
-
search=gr.Textbox()
|
|
|
93 |
limit=gr.Slider(minimum=0,maximum=10000,value=100)
|
94 |
btn=gr.Button()
|
95 |
names_json=gr.JSON()
|
96 |
models_json=gr.JSON()
|
97 |
-
btn.click(model_explorer,[search,limit],[models_json,names_json])
|
98 |
app.launch()
|
|
|
2 |
import json
|
3 |
from huggingface_hub import HfApi, ModelFilter, list_models
|
4 |
api = HfApi()
|
5 |
+
def model_explorer(search,task,limit=100):
|
6 |
# List all models
|
7 |
if limit==0:
|
8 |
limit=None
|
|
|
89 |
print (line)
|
90 |
with gr.Blocks() as app:
|
91 |
with gr.Row():
|
92 |
+
search=gr.Textbox(label="query")
|
93 |
+
task=gr.Textbox(label="task")
|
94 |
limit=gr.Slider(minimum=0,maximum=10000,value=100)
|
95 |
btn=gr.Button()
|
96 |
names_json=gr.JSON()
|
97 |
models_json=gr.JSON()
|
98 |
+
btn.click(model_explorer,[search,task,limit],[models_json,names_json])
|
99 |
app.launch()
|