Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
t0-0
commited on
Commit
•
e4af1e5
1
Parent(s):
7fcd583
Wrap column filter and model filter with Accordion
Browse files
app.py
CHANGED
@@ -390,107 +390,109 @@ with gr.Blocks() as demo_leaderboard:
|
|
390 |
show_label=False,
|
391 |
elem_id="search-bar",
|
392 |
)
|
393 |
-
with gr.
|
394 |
with gr.Row():
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
with gr.
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
|
|
|
|
494 |
|
495 |
# DataFrameコンポーネントの初期化
|
496 |
leaderboard_table = gr.Dataframe(
|
|
|
390 |
show_label=False,
|
391 |
elem_id="search-bar",
|
392 |
)
|
393 |
+
with gr.Accordion("Column Filter", open=True):
|
394 |
with gr.Row():
|
395 |
+
with gr.Row():
|
396 |
+
select_all_button = gr.Button(SELECT_ALL_BUTTON_LABEL_JA, size="sm")
|
397 |
+
select_none_button = gr.Button(SELECT_NONE_BUTTON_LABEL_JA, size="sm")
|
398 |
+
select_avg_only_button = gr.Button(SELECT_AVG_ONLY_BUTTON_LABEL_JA, size="sm")
|
399 |
+
|
400 |
+
for task_type in TaskType:
|
401 |
+
if task_type == TaskType.NotTask:
|
402 |
+
label = "Model details"
|
403 |
+
else:
|
404 |
+
label = task_type.value
|
405 |
+
with gr.Accordion(label, open=True, elem_classes="accordion"):
|
406 |
+
with gr.Row(height=110):
|
407 |
+
shown_column = gr.CheckboxGroup(
|
408 |
+
show_label=False,
|
409 |
+
choices=[
|
410 |
+
c.name
|
411 |
+
for c in fields(AutoEvalColumn)
|
412 |
+
if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
413 |
+
],
|
414 |
+
value=[
|
415 |
+
c.name
|
416 |
+
for c in fields(AutoEvalColumn)
|
417 |
+
if c.displayed_by_default
|
418 |
+
and not c.hidden
|
419 |
+
and not c.never_hidden
|
420 |
+
and c.task_type == task_type
|
421 |
+
],
|
422 |
+
elem_id="column-select",
|
423 |
+
container=False,
|
424 |
+
)
|
425 |
+
shown_columns_dict[task_type.name] = shown_column
|
426 |
+
checkboxes.append(shown_column)
|
427 |
+
|
428 |
+
# with gr.Row(height=110):
|
429 |
+
# shown_column = gr.CheckboxGroup(
|
430 |
+
# show_label=False,
|
431 |
+
# choices=[
|
432 |
+
# c.name
|
433 |
+
# for c in fields(AutoEvalColumn)
|
434 |
+
# if not c.hidden and not c.never_hidden and not c.dummy and c.task_type == task_type
|
435 |
+
# # and not c.average
|
436 |
+
# # or (task_type == TaskType.AVG and c.average)
|
437 |
+
# ],
|
438 |
+
# value=[
|
439 |
+
# c.name
|
440 |
+
# for c in fields(AutoEvalColumn)
|
441 |
+
# if c.displayed_by_default
|
442 |
+
# and not c.hidden
|
443 |
+
# and not c.never_hidden
|
444 |
+
# and c.task_type == task_type
|
445 |
+
# # and not c.average
|
446 |
+
# # or (task_type == TaskType.AVG and c.average)
|
447 |
+
# ],
|
448 |
+
# elem_id="column-select",
|
449 |
+
# container=False,
|
450 |
+
# )
|
451 |
+
# shown_columns_dict[task_type.name] = shown_column
|
452 |
+
with gr.Accordion("Model Filter", open=True):
|
453 |
+
with gr.Row():
|
454 |
+
filter_columns_type = gr.CheckboxGroup(
|
455 |
+
label="Model types",
|
456 |
+
choices=[t.to_str() for t in ModelType],
|
457 |
+
value=[t.to_str() for t in ModelType],
|
458 |
+
elem_id="filter-columns-type",
|
459 |
+
)
|
460 |
+
filter_columns_precision = gr.CheckboxGroup(
|
461 |
+
label="Precision",
|
462 |
+
choices=[i.value.name for i in Precision],
|
463 |
+
value=[i.value.name for i in Precision],
|
464 |
+
elem_id="filter-columns-precision",
|
465 |
+
)
|
466 |
+
filter_columns_size = gr.CheckboxGroup(
|
467 |
+
label="Model sizes (in billions of parameters)",
|
468 |
+
choices=list(NUMERIC_INTERVALS.keys()),
|
469 |
+
value=list(NUMERIC_INTERVALS.keys()),
|
470 |
+
elem_id="filter-columns-size",
|
471 |
+
)
|
472 |
+
filter_columns_add_special_tokens = gr.CheckboxGroup(
|
473 |
+
label="Add Special Tokens",
|
474 |
+
choices=[i.value.name for i in AddSpecialTokens],
|
475 |
+
value=[i.value.name for i in AddSpecialTokens],
|
476 |
+
elem_id="filter-columns-add-special-tokens",
|
477 |
+
)
|
478 |
+
filter_columns_num_few_shots = gr.CheckboxGroup(
|
479 |
+
label="Num Few Shots",
|
480 |
+
choices=[i.value.name for i in NumFewShots],
|
481 |
+
value=[i.value.name for i in NumFewShots],
|
482 |
+
elem_id="filter-columns-num-few-shots",
|
483 |
+
)
|
484 |
+
filter_columns_version = gr.CheckboxGroup(
|
485 |
+
label="llm-jp-eval version",
|
486 |
+
choices=[i.value.name for i in Version],
|
487 |
+
value=[i.value.name for i in Version],
|
488 |
+
elem_id="filter-columns-version",
|
489 |
+
)
|
490 |
+
# filter_columns_backend = gr.CheckboxGroup(
|
491 |
+
# label="Backend Library",
|
492 |
+
# choices=[i.value.name for i in Backend],
|
493 |
+
# value=[i.value.name for i in Backend],
|
494 |
+
# elem_id="filter-columns-backend",
|
495 |
+
# )
|
496 |
|
497 |
# DataFrameコンポーネントの初期化
|
498 |
leaderboard_table = gr.Dataframe(
|