Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,14 @@ api = HfApi()
|
|
5 |
models=[
|
6 |
"xai-org/grok-1"
|
7 |
]
|
8 |
-
def load_models():
|
9 |
loaded_model=[]
|
10 |
model_details=[]
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
for model in similar_models:
|
13 |
try:
|
14 |
loaded_model.append(gr.load(f'models/{model.id}'))
|
@@ -20,6 +24,8 @@ def load_models():
|
|
20 |
model_details.append({"MODEL":model.id,"ERROR":ee})
|
21 |
return loaded_model, model_details
|
22 |
with gr.Blocks() as app:
|
|
|
|
|
23 |
with gr.Row():
|
24 |
models_out=gr.JSON(label="Gradio Details")
|
25 |
details=gr.JSON(label="Hub Details")
|
|
|
5 |
models=[
|
6 |
"xai-org/grok-1"
|
7 |
]
|
8 |
+
def load_models(model_in):
|
9 |
loaded_model=[]
|
10 |
model_details=[]
|
11 |
+
|
12 |
+
if "/" in models:
|
13 |
+
similar_models = api.list_models(search=model_in.split("/")[1],limit=100,cardData=True)
|
14 |
+
else:
|
15 |
+
similar_models = api.list_models(search=model_in,limit=100,cardData=True)
|
16 |
for model in similar_models:
|
17 |
try:
|
18 |
loaded_model.append(gr.load(f'models/{model.id}'))
|
|
|
24 |
model_details.append({"MODEL":model.id,"ERROR":ee})
|
25 |
return loaded_model, model_details
|
26 |
with gr.Blocks() as app:
|
27 |
+
with gr.Row():
|
28 |
+
model_name=gr.Textbox(label="Model", value=models[0], placeholder=models[0])
|
29 |
with gr.Row():
|
30 |
models_out=gr.JSON(label="Gradio Details")
|
31 |
details=gr.JSON(label="Hub Details")
|