Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -444,23 +444,24 @@ with gr.Blocks() as demo_leaderboard:
|
|
| 444 |
|
| 445 |
def toggle_all_categories(action: str, shown_columns_dict: dict):
|
| 446 |
"""全カテゴリーのチェックボックスを一括制御する関数"""
|
|
|
|
| 447 |
for task_type in TaskType:
|
| 448 |
if task_type == TaskType.NotTask:
|
| 449 |
continue
|
| 450 |
|
| 451 |
if action == "all":
|
| 452 |
# 全選択: そのカテゴリーの全ての選択肢を返す
|
| 453 |
-
|
| 454 |
c.name
|
| 455 |
for c in fields(AutoEvalColumn)
|
| 456 |
if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
| 457 |
-
]
|
| 458 |
elif action == "none":
|
| 459 |
# 全解除: 空のリストを返す
|
| 460 |
-
|
| 461 |
elif action == "avg_only":
|
| 462 |
# AVGのみ: AVGに関連する選択肢のみを返す
|
| 463 |
-
|
| 464 |
c.name
|
| 465 |
for c in fields(AutoEvalColumn)
|
| 466 |
if not c.hidden and not c.never_hidden
|
|
@@ -469,7 +470,8 @@ def toggle_all_categories(action: str, shown_columns_dict: dict):
|
|
| 469 |
(task_type == TaskType.AVG) or
|
| 470 |
(task_type != TaskType.AVG and c.average)
|
| 471 |
)
|
| 472 |
-
]
|
|
|
|
| 473 |
|
| 474 |
# Submission demo
|
| 475 |
|
|
|
|
| 444 |
|
| 445 |
def toggle_all_categories(action: str, shown_columns_dict: dict):
|
| 446 |
"""全カテゴリーのチェックボックスを一括制御する関数"""
|
| 447 |
+
results = []
|
| 448 |
for task_type in TaskType:
|
| 449 |
if task_type == TaskType.NotTask:
|
| 450 |
continue
|
| 451 |
|
| 452 |
if action == "all":
|
| 453 |
# 全選択: そのカテゴリーの全ての選択肢を返す
|
| 454 |
+
results.append([
|
| 455 |
c.name
|
| 456 |
for c in fields(AutoEvalColumn)
|
| 457 |
if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
| 458 |
+
])
|
| 459 |
elif action == "none":
|
| 460 |
# 全解除: 空のリストを返す
|
| 461 |
+
results.append([])
|
| 462 |
elif action == "avg_only":
|
| 463 |
# AVGのみ: AVGに関連する選択肢のみを返す
|
| 464 |
+
results.append([
|
| 465 |
c.name
|
| 466 |
for c in fields(AutoEvalColumn)
|
| 467 |
if not c.hidden and not c.never_hidden
|
|
|
|
| 470 |
(task_type == TaskType.AVG) or
|
| 471 |
(task_type != TaskType.AVG and c.average)
|
| 472 |
)
|
| 473 |
+
])
|
| 474 |
+
return results # リストとして全ての結果を返す
|
| 475 |
|
| 476 |
# Submission demo
|
| 477 |
|