Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
•
b762711
1
Parent(s):
8f9bc6a
Added checkbox for merges
Browse files- app.py +14 -4
- src/display/utils.py +3 -3
- src/leaderboard/read_evals.py +1 -1
app.py
CHANGED
@@ -78,10 +78,11 @@ def update_table(
|
|
78 |
precision_query: str,
|
79 |
size_query: list,
|
80 |
show_deleted: bool,
|
|
|
81 |
show_flagged: bool,
|
82 |
query: str,
|
83 |
):
|
84 |
-
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted, show_flagged)
|
85 |
filtered_df = filter_queries(query, filtered_df)
|
86 |
df = select_columns(filtered_df, columns)
|
87 |
return df
|
@@ -129,7 +130,7 @@ def filter_queries(query: str, filtered_df: pd.DataFrame):
|
|
129 |
|
130 |
|
131 |
def filter_models(
|
132 |
-
df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool, show_flagged: bool
|
133 |
) -> pd.DataFrame:
|
134 |
# Show all models
|
135 |
if show_deleted:
|
@@ -137,6 +138,9 @@ def filter_models(
|
|
137 |
else: # Show only still on the hub models
|
138 |
filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True]
|
139 |
|
|
|
|
|
|
|
140 |
if not show_flagged:
|
141 |
filtered_df = filtered_df[filtered_df[AutoEvalColumn.flagged.name] == False]
|
142 |
|
@@ -151,7 +155,7 @@ def filter_models(
|
|
151 |
|
152 |
return filtered_df
|
153 |
|
154 |
-
leaderboard_df = filter_models(leaderboard_df, [t.to_str(" : ") for t in ModelType], list(NUMERIC_INTERVALS.keys()), [i.value.name for i in Precision], False, False)
|
155 |
|
156 |
demo = gr.Blocks(css=custom_css)
|
157 |
with demo:
|
@@ -188,6 +192,9 @@ with demo:
|
|
188 |
deleted_models_visibility = gr.Checkbox(
|
189 |
value=False, label="Show private/deleted models", interactive=True
|
190 |
)
|
|
|
|
|
|
|
191 |
flagged_models_visibility = gr.Checkbox(
|
192 |
value=False, label="Show flagged models", interactive=True
|
193 |
)
|
@@ -245,6 +252,7 @@ with demo:
|
|
245 |
filter_columns_precision,
|
246 |
filter_columns_size,
|
247 |
deleted_models_visibility,
|
|
|
248 |
flagged_models_visibility,
|
249 |
search_bar,
|
250 |
],
|
@@ -262,6 +270,7 @@ with demo:
|
|
262 |
filter_columns_precision,
|
263 |
filter_columns_size,
|
264 |
deleted_models_visibility,
|
|
|
265 |
flagged_models_visibility,
|
266 |
search_bar,
|
267 |
],
|
@@ -270,7 +279,7 @@ with demo:
|
|
270 |
# Check query parameter once at startup and update search bar + hidden component
|
271 |
demo.load(load_query, inputs=[], outputs=[search_bar, hidden_search_bar])
|
272 |
|
273 |
-
for selector in [shown_columns, filter_columns_type, filter_columns_precision, filter_columns_size, deleted_models_visibility, flagged_models_visibility]:
|
274 |
selector.change(
|
275 |
update_table,
|
276 |
[
|
@@ -280,6 +289,7 @@ with demo:
|
|
280 |
filter_columns_precision,
|
281 |
filter_columns_size,
|
282 |
deleted_models_visibility,
|
|
|
283 |
flagged_models_visibility,
|
284 |
search_bar,
|
285 |
],
|
|
|
78 |
precision_query: str,
|
79 |
size_query: list,
|
80 |
show_deleted: bool,
|
81 |
+
show_merges: bool,
|
82 |
show_flagged: bool,
|
83 |
query: str,
|
84 |
):
|
85 |
+
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted, show_merges, show_flagged)
|
86 |
filtered_df = filter_queries(query, filtered_df)
|
87 |
df = select_columns(filtered_df, columns)
|
88 |
return df
|
|
|
130 |
|
131 |
|
132 |
def filter_models(
|
133 |
+
df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool, show_merges: bool, show_flagged: bool
|
134 |
) -> pd.DataFrame:
|
135 |
# Show all models
|
136 |
if show_deleted:
|
|
|
138 |
else: # Show only still on the hub models
|
139 |
filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True]
|
140 |
|
141 |
+
if not show_merges:
|
142 |
+
filtered_df = filtered_df[filtered_df[AutoEvalColumn.merged.name] == False]
|
143 |
+
|
144 |
if not show_flagged:
|
145 |
filtered_df = filtered_df[filtered_df[AutoEvalColumn.flagged.name] == False]
|
146 |
|
|
|
155 |
|
156 |
return filtered_df
|
157 |
|
158 |
+
leaderboard_df = filter_models(leaderboard_df, [t.to_str(" : ") for t in ModelType], list(NUMERIC_INTERVALS.keys()), [i.value.name for i in Precision], False, False, False)
|
159 |
|
160 |
demo = gr.Blocks(css=custom_css)
|
161 |
with demo:
|
|
|
192 |
deleted_models_visibility = gr.Checkbox(
|
193 |
value=False, label="Show private/deleted models", interactive=True
|
194 |
)
|
195 |
+
merged_models_visibility = gr.Checkbox(
|
196 |
+
value=False, label="Show merges", interactive=True
|
197 |
+
)
|
198 |
flagged_models_visibility = gr.Checkbox(
|
199 |
value=False, label="Show flagged models", interactive=True
|
200 |
)
|
|
|
252 |
filter_columns_precision,
|
253 |
filter_columns_size,
|
254 |
deleted_models_visibility,
|
255 |
+
merged_models_visibility,
|
256 |
flagged_models_visibility,
|
257 |
search_bar,
|
258 |
],
|
|
|
270 |
filter_columns_precision,
|
271 |
filter_columns_size,
|
272 |
deleted_models_visibility,
|
273 |
+
merged_models_visibility,
|
274 |
flagged_models_visibility,
|
275 |
search_bar,
|
276 |
],
|
|
|
279 |
# Check query parameter once at startup and update search bar + hidden component
|
280 |
demo.load(load_query, inputs=[], outputs=[search_bar, hidden_search_bar])
|
281 |
|
282 |
+
for selector in [shown_columns, filter_columns_type, filter_columns_precision, filter_columns_size, deleted_models_visibility, merged_models_visibility, flagged_models_visibility]:
|
283 |
selector.change(
|
284 |
update_table,
|
285 |
[
|
|
|
289 |
filter_columns_precision,
|
290 |
filter_columns_size,
|
291 |
deleted_models_visibility,
|
292 |
+
merged_models_visibility,
|
293 |
flagged_models_visibility,
|
294 |
search_bar,
|
295 |
],
|
src/display/utils.py
CHANGED
@@ -46,7 +46,7 @@ auto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type",
|
|
46 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
47 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
48 |
auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
49 |
-
auto_eval_column_dict.append(["
|
50 |
auto_eval_column_dict.append(["license", ColumnContent, ColumnContent("Hub License", "str", False)])
|
51 |
auto_eval_column_dict.append(["params", ColumnContent, ColumnContent("#Params (B)", "number", False)])
|
52 |
auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️", "number", False)])
|
@@ -73,7 +73,7 @@ baseline_row = {
|
|
73 |
AutoEvalColumn.model.name: "<p>Baseline</p>",
|
74 |
AutoEvalColumn.revision.name: "N/A",
|
75 |
AutoEvalColumn.precision.name: None,
|
76 |
-
AutoEvalColumn.
|
77 |
AutoEvalColumn.average.name: 31.0,
|
78 |
AutoEvalColumn.arc.name: 25.0,
|
79 |
AutoEvalColumn.hellaswag.name: 25.0,
|
@@ -99,7 +99,7 @@ human_baseline_row = {
|
|
99 |
AutoEvalColumn.revision.name: "N/A",
|
100 |
AutoEvalColumn.precision.name: None,
|
101 |
AutoEvalColumn.average.name: 92.75,
|
102 |
-
AutoEvalColumn.
|
103 |
AutoEvalColumn.arc.name: 80.0,
|
104 |
AutoEvalColumn.hellaswag.name: 95.0,
|
105 |
AutoEvalColumn.mmlu.name: 89.8,
|
|
|
46 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
47 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
48 |
auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
49 |
+
auto_eval_column_dict.append(["merged", ColumnContent, ColumnContent("Merged", "bool", False)])
|
50 |
auto_eval_column_dict.append(["license", ColumnContent, ColumnContent("Hub License", "str", False)])
|
51 |
auto_eval_column_dict.append(["params", ColumnContent, ColumnContent("#Params (B)", "number", False)])
|
52 |
auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️", "number", False)])
|
|
|
73 |
AutoEvalColumn.model.name: "<p>Baseline</p>",
|
74 |
AutoEvalColumn.revision.name: "N/A",
|
75 |
AutoEvalColumn.precision.name: None,
|
76 |
+
AutoEvalColumn.merged.name: False,
|
77 |
AutoEvalColumn.average.name: 31.0,
|
78 |
AutoEvalColumn.arc.name: 25.0,
|
79 |
AutoEvalColumn.hellaswag.name: 25.0,
|
|
|
99 |
AutoEvalColumn.revision.name: "N/A",
|
100 |
AutoEvalColumn.precision.name: None,
|
101 |
AutoEvalColumn.average.name: 92.75,
|
102 |
+
AutoEvalColumn.merged.name: False,
|
103 |
AutoEvalColumn.arc.name: 80.0,
|
104 |
AutoEvalColumn.hellaswag.name: 95.0,
|
105 |
AutoEvalColumn.mmlu.name: 89.8,
|
src/leaderboard/read_evals.py
CHANGED
@@ -138,7 +138,7 @@ class EvalResult:
|
|
138 |
"eval_name": self.eval_name, # not a column, just a save name,
|
139 |
AutoEvalColumn.precision.name: self.precision.value.name,
|
140 |
AutoEvalColumn.model_type.name: self.model_type.value.name,
|
141 |
-
AutoEvalColumn.
|
142 |
AutoEvalColumn.model_type_symbol.name: self.model_type.value.symbol,
|
143 |
AutoEvalColumn.weight_type.name: self.weight_type.value.name,
|
144 |
AutoEvalColumn.architecture.name: self.architecture,
|
|
|
138 |
"eval_name": self.eval_name, # not a column, just a save name,
|
139 |
AutoEvalColumn.precision.name: self.precision.value.name,
|
140 |
AutoEvalColumn.model_type.name: self.model_type.value.name,
|
141 |
+
AutoEvalColumn.merged.name: self.merge,
|
142 |
AutoEvalColumn.model_type_symbol.name: self.model_type.value.symbol,
|
143 |
AutoEvalColumn.weight_type.name: self.weight_type.value.name,
|
144 |
AutoEvalColumn.architecture.name: self.architecture,
|