Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Fix
Browse files
app.py
CHANGED
@@ -232,47 +232,41 @@ def load_query(request: gr.Request): # triggered only once at startup => read q
|
|
232 |
) # return one for the "search_bar", one for a hidden component that triggers a reload only if value has changed
|
233 |
|
234 |
|
235 |
-
def toggle_all_categories(action: str):
|
236 |
"""全カテゴリーのチェックボックスを一括制御する関数"""
|
237 |
results = []
|
238 |
for task_type in TaskType:
|
239 |
if task_type == TaskType.NotTask:
|
240 |
# Model detailsの場合は既存の選択状態を維持
|
241 |
-
results.append(
|
242 |
-
[
|
243 |
-
c.name
|
244 |
-
for c in fields(AutoEvalColumn)
|
245 |
-
if not c.hidden
|
246 |
-
and not c.never_hidden
|
247 |
-
and not c.dummy
|
248 |
-
and c.task_type == task_type
|
249 |
-
and c.displayed_by_default # デフォルトの表示状態を維持
|
250 |
-
]
|
251 |
-
)
|
252 |
else:
|
253 |
if action == "all":
|
254 |
# 全選択
|
255 |
results.append(
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
261 |
)
|
262 |
elif action == "none":
|
263 |
# 全解除
|
264 |
-
results.append([])
|
265 |
elif action == "avg_only":
|
266 |
# AVGのみ
|
267 |
results.append(
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
|
|
|
|
276 |
)
|
277 |
return results
|
278 |
|
|
|
232 |
) # return one for the "search_bar", one for a hidden component that triggers a reload only if value has changed
|
233 |
|
234 |
|
235 |
+
def toggle_all_categories(action: str) -> list[gr.CheckboxGroup]:
|
236 |
"""全カテゴリーのチェックボックスを一括制御する関数"""
|
237 |
results = []
|
238 |
for task_type in TaskType:
|
239 |
if task_type == TaskType.NotTask:
|
240 |
# Model detailsの場合は既存の選択状態を維持
|
241 |
+
results.append(gr.CheckboxGroup())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
else:
|
243 |
if action == "all":
|
244 |
# 全選択
|
245 |
results.append(
|
246 |
+
gr.CheckboxGroup(
|
247 |
+
value=[
|
248 |
+
c.name
|
249 |
+
for c in fields(AutoEvalColumn)
|
250 |
+
if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
251 |
+
]
|
252 |
+
)
|
253 |
)
|
254 |
elif action == "none":
|
255 |
# 全解除
|
256 |
+
results.append(gr.CheckboxGroup(value=[]))
|
257 |
elif action == "avg_only":
|
258 |
# AVGのみ
|
259 |
results.append(
|
260 |
+
gr.CheckboxGroup(
|
261 |
+
value=[
|
262 |
+
c.name
|
263 |
+
for c in fields(AutoEvalColumn)
|
264 |
+
if not c.hidden
|
265 |
+
and not c.never_hidden
|
266 |
+
and c.task_type == task_type
|
267 |
+
and ((task_type == TaskType.AVG) or (task_type != TaskType.AVG and c.average))
|
268 |
+
]
|
269 |
+
)
|
270 |
)
|
271 |
return results
|
272 |
|