hysts HF staff commited on
Commit
e4bb553
1 Parent(s): 32da55f
Files changed (1) hide show
  1. app.py +16 -16
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(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
305
- df2 = hidden_df[hidden_df[AutoEvalColumn.row_id.name].isin(df[AutoEvalColumn.row_id.name])]
306
- df2 = df2[df2["#Params (B)"] > 0]
307
- df2 = df2[["model_name_for_query", "#Params (B)", "AVG", "Few-shot"]]
308
- df2["AVG"] = df2["AVG"].astype(float)
309
- df2 = df2.rename(columns={"model_name_for_query": "Model", "Few-shot": "n-shot"})
310
- df2["model_name_without_org_name"] = df2["Model"].str.split("/").str[-1] + " (" + df2["n-shot"] + "-shot)"
311
  fig = px.scatter(
312
- df2,
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(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
332
- df2 = hidden_df[hidden_df[AutoEvalColumn.row_id.name].isin(df[AutoEvalColumn.row_id.name])]
333
- df2 = df2[["model_name_for_query", "Few-shot"] + list(TASK_AVG_NAME_MAP.keys())]
334
- df2 = df2.rename(columns={"model_name_for_query": "Model", "Few-shot": "n-shot"})
335
- df2 = df2.rename(columns=TASK_AVG_NAME_MAP)
336
- df2["n-shot"] = df2["n-shot"].astype(int)
337
- df2 = df2.set_index(["Model", "n-shot"]).astype(float)
338
 
339
  fig = go.Figure()
340
- for i, ((name, n_shot), row) in enumerate(df2.iterrows()):
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(