Spaces:
Runtime error
Runtime error
Refactor init_leaderboard function to update data outputs to dataframe and improve dropdown UI
Browse files
app.py
CHANGED
@@ -95,7 +95,8 @@ def init_leaderboard(dataframes):
|
|
95 |
return update_data(subset, research_textbox, selected_columns)
|
96 |
|
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")
|
|
|
95 |
return update_data(subset, research_textbox, selected_columns)
|
96 |
|
97 |
def update_data(subset, search_term, selected_columns):
|
98 |
+
return gr.DataFrame(dataframes[subset][dataframes[subset].model.str.contains(search_term, case=False)][selected_columns], type="pandas", datatype=[c.type for c in fields(AutoEvalColumn)])
|
99 |
+
# ])#datatype=[c.type for c in fields(AutoEvalColumn) if c.name in selected_columns])
|
100 |
|
101 |
with gr.Row():
|
102 |
refresh_button = gr.Button("Refresh")
|