Spaces:
Running
Running
Change `model_tournament_results_table` when changed selected category
Browse files
app.py
CHANGED
|
@@ -163,7 +163,7 @@ def fetch_model_tournament_results_table(submission_id, category):
|
|
| 163 |
visible=True,
|
| 164 |
)
|
| 165 |
|
| 166 |
-
def change_leaderboard_category(category):
|
| 167 |
if category == leaderboard_server.TASKS_CATEGORY_OVERALL:
|
| 168 |
task_abbreviation_legend = gr.update(
|
| 169 |
visible=False,
|
|
@@ -197,7 +197,7 @@ def change_leaderboard_category(category):
|
|
| 197 |
visible=True,
|
| 198 |
)
|
| 199 |
|
| 200 |
-
model_tournament_results_table =
|
| 201 |
|
| 202 |
return (
|
| 203 |
gr.update(
|
|
@@ -372,7 +372,10 @@ with gr.Blocks(theme=gr.themes.Soft(text_size=text_md), css=custom_css) as main:
|
|
| 372 |
|
| 373 |
category_of_tasks.change(
|
| 374 |
fn=change_leaderboard_category,
|
| 375 |
-
inputs=
|
|
|
|
|
|
|
|
|
|
| 376 |
outputs=[
|
| 377 |
results_table,
|
| 378 |
results_table_legend,
|
|
|
|
| 163 |
visible=True,
|
| 164 |
)
|
| 165 |
|
| 166 |
+
def change_leaderboard_category(category, selected_submission_id):
|
| 167 |
if category == leaderboard_server.TASKS_CATEGORY_OVERALL:
|
| 168 |
task_abbreviation_legend = gr.update(
|
| 169 |
visible=False,
|
|
|
|
| 197 |
visible=True,
|
| 198 |
)
|
| 199 |
|
| 200 |
+
model_tournament_results_table = fetch_model_tournament_results_table(selected_submission_id, category)
|
| 201 |
|
| 202 |
return (
|
| 203 |
gr.update(
|
|
|
|
| 372 |
|
| 373 |
category_of_tasks.change(
|
| 374 |
fn=change_leaderboard_category,
|
| 375 |
+
inputs=[
|
| 376 |
+
category_of_tasks,
|
| 377 |
+
tournament_results_dropdown,
|
| 378 |
+
],
|
| 379 |
outputs=[
|
| 380 |
results_table,
|
| 381 |
results_table_legend,
|