idolezal commited on
Commit
db6d5bf
1 Parent(s): a4ae5ca

change_leaderboard_category

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -121,6 +121,13 @@ def fetch_model_detail(submission_id):
121
  gr.update(value=metadata['link_to_model'], visible=True)
122
  )
123
 
 
 
 
 
 
 
 
124
 
125
  def show_modal():
126
  return gr.update(visible=True)
@@ -208,6 +215,7 @@ with gr.Blocks(theme=gr.themes.Soft(text_size=text_md), css=custom_css) as main:
208
  with gr.Row():
209
  category_of_tasks = gr.Dropdown(
210
  choices=[leaderboard_server.tasks_category_overall] + list(leaderboard_server.tasks_categories),
 
211
  label="Category of benchmark",
212
  interactive=True,
213
  )
@@ -221,6 +229,12 @@ with gr.Blocks(theme=gr.themes.Soft(text_size=text_md), css=custom_css) as main:
221
  datatype="markdown",
222
  elem_classes="leaderboard-table",
223
  )
 
 
 
 
 
 
224
 
225
  with gr.Tab('Model details'):
226
  gr.Markdown(MORE_DETAILS_MARKDOWN)
 
121
  gr.update(value=metadata['link_to_model'], visible=True)
122
  )
123
 
124
+ def change_leaderboard_category(category):
125
+ return (
126
+ gr.update(
127
+ value=leaderboard_server.get_leaderboard(category=category),
128
+ datatype="markdown",
129
+ ),
130
+ )
131
 
132
  def show_modal():
133
  return gr.update(visible=True)
 
215
  with gr.Row():
216
  category_of_tasks = gr.Dropdown(
217
  choices=[leaderboard_server.tasks_category_overall] + list(leaderboard_server.tasks_categories),
218
+ value=leaderboard_server.tasks_category_overall,
219
  label="Category of benchmark",
220
  interactive=True,
221
  )
 
229
  datatype="markdown",
230
  elem_classes="leaderboard-table",
231
  )
232
+
233
+ category_of_tasks.change(
234
+ fn=change_leaderboard_category,
235
+ inputs=[category_of_tasks],
236
+ outputs=[results_table],
237
+ )
238
 
239
  with gr.Tab('Model details'):
240
  gr.Markdown(MORE_DETAILS_MARKDOWN)