hysts HF staff commited on
Commit
55304ba
·
1 Parent(s): 06b3207
Files changed (1) hide show
  1. app.py +22 -3
app.py CHANGED
@@ -330,9 +330,9 @@ with gr.Blocks() as demo_leaderboard:
330
  shown_columns_dict = {}
331
  checkboxes = []
332
  with gr.Row():
333
- gr.Button("全選択", size="sm").click(fn=lambda: toggle_all_categories("all"), outputs=checkboxes)
334
- gr.Button("全解除", size="sm").click(fn=lambda: toggle_all_categories("none"), outputs=checkboxes)
335
- gr.Button("AVGのみ", size="sm").click(fn=lambda: toggle_all_categories("avg_only"), outputs=checkboxes)
336
 
337
  for task_type in TaskType:
338
  if task_type == TaskType.NotTask:
@@ -451,6 +451,25 @@ with gr.Blocks() as demo_leaderboard:
451
  # Define a hidden component that will trigger a reload only if a query parameter has been set
452
  hidden_search_bar = gr.Textbox(value="", visible=False)
453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  gr.on(
455
  triggers=[
456
  hidden_search_bar.change,
 
330
  shown_columns_dict = {}
331
  checkboxes = []
332
  with gr.Row():
333
+ select_all_button = gr.Button("全選択", size="sm")
334
+ select_none_button = gr.Button("全解除", size="sm")
335
+ select_avg_only_button = gr.Button("AVGのみ", size="sm")
336
 
337
  for task_type in TaskType:
338
  if task_type == TaskType.NotTask:
 
451
  # Define a hidden component that will trigger a reload only if a query parameter has been set
452
  hidden_search_bar = gr.Textbox(value="", visible=False)
453
 
454
+ select_all_button.click(
455
+ fn=lambda: toggle_all_categories("all"),
456
+ outputs=checkboxes,
457
+ api_name=False,
458
+ queue=False,
459
+ )
460
+ select_none_button.click(
461
+ fn=lambda: toggle_all_categories("none"),
462
+ outputs=checkboxes,
463
+ api_name=False,
464
+ queue=False,
465
+ )
466
+ select_avg_only_button.click(
467
+ fn=lambda: toggle_all_categories("avg_only"),
468
+ outputs=checkboxes,
469
+ api_name=False,
470
+ queue=False,
471
+ )
472
+
473
  gr.on(
474
  triggers=[
475
  hidden_search_bar.change,