pufanyi commited on
Commit
6ec681c
1 Parent(s): ad9004c

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

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -102,6 +102,7 @@ def init_leaderboard(dataframes):
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])
107
 
 
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_columns = [c.name for c in fields(AutoEvalColumn) if c.name in selected_columns]
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])
108