Spaces:
Restarting
Restarting
Refactor init_leaderboard function to update data outputs to dataframe and improve dropdown UI
Browse files
app.py
CHANGED
@@ -95,8 +95,9 @@ def init_leaderboard(dataframes):
|
|
95 |
return update_data(subset, research_textbox, selected_columns)
|
96 |
|
97 |
def update_data(subset, search_term, selected_columns):
|
98 |
-
|
99 |
-
|
|
|
100 |
|
101 |
with gr.Row():
|
102 |
refresh_button = gr.Button("Refresh")
|
|
|
95 |
return update_data(subset, research_textbox, selected_columns)
|
96 |
|
97 |
def update_data(subset, search_term, selected_columns):
|
98 |
+
filtered_data = dataframes[subset][dataframes[subset]['Model Name'].str.contains(search_term, case=False)]
|
99 |
+
selected_data = filtered_data[selected_columns]
|
100 |
+
return gr.DataFrame(selected_data, type="pandas", datatype=[c.type for c in fields(AutoEvalColumn) if c.name in selected_columns])
|
101 |
|
102 |
with gr.Row():
|
103 |
refresh_button = gr.Button("Refresh")
|