Update app.py
Browse files
app.py
CHANGED
@@ -313,6 +313,10 @@ def select(df, data: gr.SelectData):
|
|
313 |
print('selected_values', selected_values, selected_indices)
|
314 |
return gr.CheckboxGroup(list(selected_values.keys()))
|
315 |
|
|
|
|
|
|
|
|
|
316 |
def generate_spider_chart(df, selected_keys):
|
317 |
global selected_values
|
318 |
print('generate_spider_chart', selected_values, selected_keys)
|
@@ -425,10 +429,10 @@ with demo:
|
|
425 |
filter_columns_groupDtype = gr.Dropdown(choices=[i.value.name for i in GroupDtype], label="Group Size", multiselect=False, value="All", interactive=True,)
|
426 |
|
427 |
with gr.Row():
|
428 |
-
with gr.Column(scale=
|
429 |
-
model_comparison = gr.CheckboxGroup(label="Accuracy Comparison on Selected Models", choices=list(selected_values.keys()), value=
|
430 |
with gr.Column(scale=1):
|
431 |
-
spider_btn = gr.Button("
|
432 |
|
433 |
|
434 |
leaderboard_table = gr.components.Dataframe(
|
@@ -451,6 +455,7 @@ with demo:
|
|
451 |
leaderboard_table.select(select, leaderboard_table, model_comparison)
|
452 |
spider_btn.click(generate_spider_chart, [leaderboard_table, model_comparison], map)
|
453 |
spider_btn.click(lambda: Modal(visible=True), None, modal)
|
|
|
454 |
|
455 |
# Dummy leaderboard for handling the case when the user uses backspace key
|
456 |
hidden_leaderboard_table_for_search = gr.components.Dataframe(
|
|
|
313 |
print('selected_values', selected_values, selected_indices)
|
314 |
return gr.CheckboxGroup(list(selected_values.keys()))
|
315 |
|
316 |
+
def init_comparison_data():
|
317 |
+
global selected_values
|
318 |
+
return gr.CheckboxGroup(choices=list(selected_values.keys()), value=list(selected_values.keys()))
|
319 |
+
|
320 |
def generate_spider_chart(df, selected_keys):
|
321 |
global selected_values
|
322 |
print('generate_spider_chart', selected_values, selected_keys)
|
|
|
429 |
filter_columns_groupDtype = gr.Dropdown(choices=[i.value.name for i in GroupDtype], label="Group Size", multiselect=False, value="All", interactive=True,)
|
430 |
|
431 |
with gr.Row():
|
432 |
+
with gr.Column(scale=6):
|
433 |
+
model_comparison = gr.CheckboxGroup(label="Accuracy Comparison on Selected Models", choices=list(selected_values.keys()), value=list(selected_values.keys()), interactive=True, elem_id="model_comparison")
|
434 |
with gr.Column(scale=1):
|
435 |
+
spider_btn = gr.Button("Compare")
|
436 |
|
437 |
|
438 |
leaderboard_table = gr.components.Dataframe(
|
|
|
455 |
leaderboard_table.select(select, leaderboard_table, model_comparison)
|
456 |
spider_btn.click(generate_spider_chart, [leaderboard_table, model_comparison], map)
|
457 |
spider_btn.click(lambda: Modal(visible=True), None, modal)
|
458 |
+
demo.load(init_comparison_data, None, model_comparison)
|
459 |
|
460 |
# Dummy leaderboard for handling the case when the user uses backspace key
|
461 |
hidden_leaderboard_table_for_search = gr.components.Dataframe(
|