Spaces:
Running
Running
Refactor init_leaderboard function to update data outputs to df
Browse files
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 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
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)
|