pufanyi commited on
Commit
00599d4
1 Parent(s): ff466fd

Refactor init_leaderboard function to update data outputs to df

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -97,16 +97,16 @@ def init_leaderboard(dataframes):
97
  def update_data(subset, search_term, selected_columns):
98
  return dataframes[subset][dataframes[subset].model.str.contains(search_term, case=False)][selected_columns]
99
 
100
- # with gr.Row():
101
- # refresh_button = gr.Button("Refresh")
102
- # refresh_button.click(
103
- # refresh,
104
- # inputs=[
105
- # selected_subset,
106
- # ],
107
- # outputs=data,
108
- # concurrency_limit=20,
109
- # )
110
 
111
  selected_subset.change(update_data, inputs=[selected_subset, research_textbox, selected_columns], outputs=df)
112
  research_textbox.submit(update_data, inputs=[selected_subset, research_textbox, selected_columns], outputs=df)
 
97
  def update_data(subset, search_term, selected_columns):
98
  return dataframes[subset][dataframes[subset].model.str.contains(search_term, case=False)][selected_columns]
99
 
100
+ with gr.Row():
101
+ refresh_button = gr.Button("Refresh")
102
+ refresh_button.click(
103
+ refresh,
104
+ inputs=[
105
+ selected_subset,
106
+ ],
107
+ outputs=df,
108
+ concurrency_limit=20,
109
+ )
110
 
111
  selected_subset.change(update_data, inputs=[selected_subset, research_textbox, selected_columns], outputs=df)
112
  research_textbox.submit(update_data, inputs=[selected_subset, research_textbox, selected_columns], outputs=df)