Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clean up
Browse files
app.py
CHANGED
@@ -301,15 +301,15 @@ def toggle_all_categories(action: str) -> list[gr.CheckboxGroup]:
|
|
301 |
return results
|
302 |
|
303 |
|
304 |
-
def plot_size_vs_score(
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
fig = px.scatter(
|
312 |
-
|
313 |
x="#Params (B)",
|
314 |
y="AVG",
|
315 |
text="model_name_without_org_name",
|
@@ -328,16 +328,16 @@ TASK_AVG_NAME_MAP = {
|
|
328 |
}
|
329 |
|
330 |
|
331 |
-
def plot_average_scores(
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
|
339 |
fig = go.Figure()
|
340 |
-
for i, ((name, n_shot), row) in enumerate(
|
341 |
visible = True if i < 3 else "legendonly" # Display only the first 3 models
|
342 |
fig.add_trace(
|
343 |
go.Scatterpolar(
|
|
|
301 |
return results
|
302 |
|
303 |
|
304 |
+
def plot_size_vs_score(df_filtered: pd.DataFrame, df_original: pd.DataFrame) -> go.Figure:
|
305 |
+
df = df_original[df_original[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
306 |
+
df = df[df["#Params (B)"] > 0]
|
307 |
+
df = df[["model_name_for_query", "#Params (B)", "AVG", "Few-shot"]]
|
308 |
+
df["AVG"] = df["AVG"].astype(float)
|
309 |
+
df = df.rename(columns={"model_name_for_query": "Model", "Few-shot": "n-shot"})
|
310 |
+
df["model_name_without_org_name"] = df["Model"].str.split("/").str[-1] + " (" + df["n-shot"] + "-shot)"
|
311 |
fig = px.scatter(
|
312 |
+
df,
|
313 |
x="#Params (B)",
|
314 |
y="AVG",
|
315 |
text="model_name_without_org_name",
|
|
|
328 |
}
|
329 |
|
330 |
|
331 |
+
def plot_average_scores(df_filtered: pd.DataFrame, df_original: pd.DataFrame) -> go.Figure:
|
332 |
+
df = df_original[df_original[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
333 |
+
df = df[["model_name_for_query", "Few-shot"] + list(TASK_AVG_NAME_MAP.keys())]
|
334 |
+
df = df.rename(columns={"model_name_for_query": "Model", "Few-shot": "n-shot"})
|
335 |
+
df = df.rename(columns=TASK_AVG_NAME_MAP)
|
336 |
+
df["n-shot"] = df["n-shot"].astype(int)
|
337 |
+
df = df.set_index(["Model", "n-shot"]).astype(float)
|
338 |
|
339 |
fig = go.Figure()
|
340 |
+
for i, ((name, n_shot), row) in enumerate(df.iterrows()):
|
341 |
visible = True if i < 3 else "legendonly" # Display only the first 3 models
|
342 |
fig.add_trace(
|
343 |
go.Scatterpolar(
|