Spaces:
Running
Running
Refactor init_leaderboard function to update data outputs to dataframe and improve dropdown UI
Browse files
app.py
CHANGED
@@ -97,11 +97,10 @@ def init_leaderboard(dataframes):
|
|
97 |
selected_subset.choices = subsets
|
98 |
return update_data(subset, research_textbox, selected_columns)
|
99 |
|
100 |
-
def update_data(subset, search_term, selected_columns
|
101 |
-
|
102 |
-
print(
|
103 |
-
print(
|
104 |
-
print(selected_columns)
|
105 |
filtered_data = dataframes[subset][dataframes[subset]['Model Name'].str.contains(search_term, case=False)]
|
106 |
selected_data = filtered_data[selected_columns]
|
107 |
return gr.DataFrame(selected_data, type="pandas", datatype=[c.type for c in fields(AutoEvalColumn) if c.name in selected_columns])
|
|
|
97 |
selected_subset.choices = subsets
|
98 |
return update_data(subset, research_textbox, selected_columns)
|
99 |
|
100 |
+
def update_data(subset, search_term, selected_columns):
|
101 |
+
print("Subset:", subset)
|
102 |
+
print("Search Term:", search_term)
|
103 |
+
print("Selected Columns:", selected_columns)
|
|
|
104 |
filtered_data = dataframes[subset][dataframes[subset]['Model Name'].str.contains(search_term, case=False)]
|
105 |
selected_data = filtered_data[selected_columns]
|
106 |
return gr.DataFrame(selected_data, type="pandas", datatype=[c.type for c in fields(AutoEvalColumn) if c.name in selected_columns])
|