Spaces:
Running
Running
Update app.py
Browse fileschanging list to dict for tasks
app.py
CHANGED
@@ -18,8 +18,10 @@ API = HfApi(token=TOKEN)
|
|
18 |
|
19 |
|
20 |
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
|
24 |
@dataclass
|
25 |
class ModelDetails:
|
@@ -52,7 +54,7 @@ def add_new_eval(
|
|
52 |
requests= load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN)
|
53 |
requests_dset = requests.to_pandas()
|
54 |
model_list= requests_dset[requests_dset['status'] == 'COMPLETED']['model'].tolist()
|
55 |
-
task_models = list(API.list_models(filter=task
|
56 |
task_model_names = [m.id for m in task_models]
|
57 |
if repo_id in model_list:
|
58 |
return 'This model has already been run!'
|
@@ -116,7 +118,7 @@ with gr.Blocks() as demo:
|
|
116 |
with gr.Row():
|
117 |
with gr.Column():
|
118 |
task = gr.Dropdown(
|
119 |
-
choices=
|
120 |
label="Choose a benchmark task",
|
121 |
value = 'Text Generation',
|
122 |
multiselect=False,
|
|
|
18 |
|
19 |
|
20 |
|
21 |
+
task_mappings = {'ASR':'text-to-speech', 'Object Detection': 'object-detection', 'Text Classification': 'text-classification',
|
22 |
+
'Image Captioning':'image-to-text', 'Question Answering':'question-answering', 'Text Generation': 'text-generation',
|
23 |
+
'Image Classification':'image-classification', 'Sentence Similarity': 'sentence-similarity',
|
24 |
+
'Image Generation':'image-generation', 'Summarization':'summarization'}
|
25 |
|
26 |
@dataclass
|
27 |
class ModelDetails:
|
|
|
54 |
requests= load_dataset("EnergyStarAI/requests_debug", split="test", token=TOKEN)
|
55 |
requests_dset = requests.to_pandas()
|
56 |
model_list= requests_dset[requests_dset['status'] == 'COMPLETED']['model'].tolist()
|
57 |
+
task_models = list(API.list_models(filter=task_mappings[task]))
|
58 |
task_model_names = [m.id for m in task_models]
|
59 |
if repo_id in model_list:
|
60 |
return 'This model has already been run!'
|
|
|
118 |
with gr.Row():
|
119 |
with gr.Column():
|
120 |
task = gr.Dropdown(
|
121 |
+
choices=task_mappings.keys(),
|
122 |
label="Choose a benchmark task",
|
123 |
value = 'Text Generation',
|
124 |
multiselect=False,
|