Spaces:
Runtime error
Runtime error
File size: 696 Bytes
3c20eb9 322a977 5a07619 ac8553a b43a77a 322a977 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import gradio as gr
import json
from huggingface_hub import HfApi, ModelFilter, list_models
api = HfApi()
def model_explorer():
# List all models
filt = ModelFilter(task="text-classification")
this = api.list_models(limit=100,filter=filt,cardData=True)
for i,mod in enumerate(this):
print(dir(mod))
print(mod.id)
print(mod.downloads)
print(mod.likes)
print(mod.pipeline_tag)
out = mod.id
return out
def tasks_json():
with open("tasks.json", "r") as read_file:
print("Read JSON file")
tasks = json.load(read_file)
print("Before Pretty Printing JSON Data")
print(tasks)
tasks_json() |