hysts HF staff commited on
Commit
bccc76a
·
1 Parent(s): 95df80d

Apply ruff

Browse files
Files changed (1) hide show
  1. app.py +26 -27
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
- else:
231
- if action == "all":
232
- # Select all
233
- results.append(
234
- gr.CheckboxGroup(
235
- value=[
236
- c.name
237
- for c in fields(AutoEvalColumn)
238
- if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
239
- ]
240
- )
241
  )
242
- elif action == "none":
243
- # Deselect all
244
- results.append(gr.CheckboxGroup(value=[]))
245
- elif action == "avg_only":
246
- # Select only AVG metrics
247
- results.append(
248
- gr.CheckboxGroup(
249
- value=[
250
- c.name
251
- for c in fields(AutoEvalColumn)
252
- if not c.hidden
253
- and not c.never_hidden
254
- and c.task_type == task_type
255
- and ((task_type == TaskType.AVG) or (task_type != TaskType.AVG and c.average))
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