pufanyi commited on
Commit
e5a7fef
·
1 Parent(s): f5f1257

Refactor init_leaderboard function to sort selected data by "Total" column in descending order

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -113,7 +113,7 @@ def init_leaderboard(dataframes):
113
  filtered_data = dataframes[subset]
114
  if search_term:
115
  filtered_data = filtered_data[dataframes[subset]["Model Name"].str.contains(search_term, case=False)]
116
- filtered_data = filtered_data.sort_values(by="Total", ascending=False, inplace=True)
117
  selected_columns = [c.name for c in fields(AutoEvalColumn) if c.name in selected_columns]
118
  selected_data = filtered_data[selected_columns]
119
  return gr.DataFrame(
 
113
  filtered_data = dataframes[subset]
114
  if search_term:
115
  filtered_data = filtered_data[dataframes[subset]["Model Name"].str.contains(search_term, case=False)]
116
+ filtered_data.sort_values(by="Total", ascending=False, inplace=True)
117
  selected_columns = [c.name for c in fields(AutoEvalColumn) if c.name in selected_columns]
118
  selected_data = filtered_data[selected_columns]
119
  return gr.DataFrame(