Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,14 @@ from huggingface_hub import HfApi, ModelFilter, list_models
|
|
| 4 |
api = HfApi()
|
| 5 |
def model_explorer(limit=100,task='text-generation'):
|
| 6 |
# List all models
|
|
|
|
| 7 |
filt = ModelFilter(task="text-generation")
|
| 8 |
|
| 9 |
this = api.list_models(limit=limit,filter=filt,cardData=True)
|
| 10 |
-
|
| 11 |
for i,mod in enumerate(this):
|
| 12 |
-
|
|
|
|
| 13 |
print(dir(mod))
|
| 14 |
print(mod.id)
|
| 15 |
print(mod.downloads)
|
|
@@ -17,7 +19,7 @@ def model_explorer(limit=100,task='text-generation'):
|
|
| 17 |
print(mod.pipeline_tag)
|
| 18 |
out = mod.id
|
| 19 |
'''
|
| 20 |
-
return
|
| 21 |
|
| 22 |
model_explorer()
|
| 23 |
def tasks_json():
|
|
|
|
| 4 |
api = HfApi()
|
| 5 |
def model_explorer(limit=100,task='text-generation'):
|
| 6 |
# List all models
|
| 7 |
+
out_box=[]
|
| 8 |
filt = ModelFilter(task="text-generation")
|
| 9 |
|
| 10 |
this = api.list_models(limit=limit,filter=filt,cardData=True)
|
| 11 |
+
|
| 12 |
for i,mod in enumerate(this):
|
| 13 |
+
out_box.append(mod)
|
| 14 |
+
'''
|
| 15 |
print(dir(mod))
|
| 16 |
print(mod.id)
|
| 17 |
print(mod.downloads)
|
|
|
|
| 19 |
print(mod.pipeline_tag)
|
| 20 |
out = mod.id
|
| 21 |
'''
|
| 22 |
+
return out_box
|
| 23 |
|
| 24 |
model_explorer()
|
| 25 |
def tasks_json():
|