pufanyi commited on
Commit
ad9004c
1 Parent(s): 8a1669a

Refactor init_leaderboard function to update data outputs to dataframe and improve dropdown UI

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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: CheckboxGroup):
101
- selected_columns = selected_columns.value
102
- print(subset)
103
- print(search_term)
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])