Spaces:
Runtime error
Runtime error
Refactor GET_DEFAULT_CHECKBOX function to remove "Model Name" column and handle exceptions in app.py
Browse files
app.py
CHANGED
@@ -129,8 +129,9 @@ def init_leaderboard(dataframes):
|
|
129 |
filtered_data = filtered_data[dataframes[subset]["Model Name"].str.contains(search_term, case=False)]
|
130 |
filtered_data.sort_values(by="Total", ascending=False, inplace=True)
|
131 |
# selected_columns.append("Model Name")
|
|
|
132 |
selected_columns = [
|
133 |
-
c for c in filtered_data.columns if c in selected_columns
|
134 |
]
|
135 |
# selected_columns = [c.name for c in fields(AutoEvalColumn) if c.name in selected_columns]
|
136 |
selected_data = filtered_data[selected_columns]
|
|
|
129 |
filtered_data = filtered_data[dataframes[subset]["Model Name"].str.contains(search_term, case=False)]
|
130 |
filtered_data.sort_values(by="Total", ascending=False, inplace=True)
|
131 |
# selected_columns.append("Model Name")
|
132 |
+
selected_columns = list(selected_columns)
|
133 |
selected_columns = [
|
134 |
+
c for c in filtered_data.columns if c in selected_columns or c == "Model Name"
|
135 |
]
|
136 |
# selected_columns = [c.name for c in fields(AutoEvalColumn) if c.name in selected_columns]
|
137 |
selected_data = filtered_data[selected_columns]
|