Spaces:
Runtime error
Runtime error
Refactor init_leaderboard function to sort selected data by "Total" column in descending order
Browse files
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
|
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(
|