Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Apply ruff
Browse files
app.py
CHANGED
@@ -227,35 +227,34 @@ def toggle_all_categories(action: str) -> list[gr.CheckboxGroup]:
|
|
227 |
if task_type == TaskType.NotTask:
|
228 |
# Maintain existing selection for Model details
|
229 |
results.append(gr.CheckboxGroup())
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
]
|
240 |
-
)
|
241 |
)
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
)
|
|
|
259 |
return results
|
260 |
|
261 |
|
|
|
227 |
if task_type == TaskType.NotTask:
|
228 |
# Maintain existing selection for Model details
|
229 |
results.append(gr.CheckboxGroup())
|
230 |
+
elif action == "all":
|
231 |
+
# Select all
|
232 |
+
results.append(
|
233 |
+
gr.CheckboxGroup(
|
234 |
+
value=[
|
235 |
+
c.name
|
236 |
+
for c in fields(AutoEvalColumn)
|
237 |
+
if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
238 |
+
]
|
|
|
|
|
239 |
)
|
240 |
+
)
|
241 |
+
elif action == "none":
|
242 |
+
# Deselect all
|
243 |
+
results.append(gr.CheckboxGroup(value=[]))
|
244 |
+
elif action == "avg_only":
|
245 |
+
# Select only AVG metrics
|
246 |
+
results.append(
|
247 |
+
gr.CheckboxGroup(
|
248 |
+
value=[
|
249 |
+
c.name
|
250 |
+
for c in fields(AutoEvalColumn)
|
251 |
+
if not c.hidden
|
252 |
+
and not c.never_hidden
|
253 |
+
and c.task_type == task_type
|
254 |
+
and ((task_type == TaskType.AVG) or (task_type != TaskType.AVG and c.average))
|
255 |
+
]
|
256 |
)
|
257 |
+
)
|
258 |
return results
|
259 |
|
260 |
|