hysts HF staff commited on
Commit
4ed5040
·
1 Parent(s): c106bef
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -338,15 +338,17 @@ def plot_size_vs_score(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
338
  return fig
339
 
340
 
 
 
 
 
 
 
341
  def plot_average_scores(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
342
  df2 = hidden_df.iloc[df.index]
343
- df2 = df2[["model_name_for_query"] + [column for column in df.columns if column.startswith("AVG ")]]
344
  df2 = df2.rename(columns={"model_name_for_query": "Model"})
345
- df2 = df2.rename(
346
- columns={
347
- column: column.replace("AVG (", "").replace(")", "") for column in df2.columns if column.startswith("AVG ")
348
- }
349
- )
350
  df2 = df2.set_index("Model").astype(float)
351
 
352
  fig = go.Figure()
 
338
  return fig
339
 
340
 
341
+ TASK_AVG_COLUMNS = [c.name for c in fields(AutoEvalColumn) if c.average and c.task_type != TaskType.AVG]
342
+ TASK_AVG_NAME_MAP = {
343
+ c.name: c.task_type.name for c in fields(AutoEvalColumn) if c.average and c.task_type != TaskType.AVG
344
+ }
345
+
346
+
347
  def plot_average_scores(df: pd.DataFrame, hidden_df: pd.DataFrame) -> go.Figure:
348
  df2 = hidden_df.iloc[df.index]
349
+ df2 = df2[["model_name_for_query"] + TASK_AVG_COLUMNS]
350
  df2 = df2.rename(columns={"model_name_for_query": "Model"})
351
+ df2 = df2.rename(columns=TASK_AVG_NAME_MAP)
 
 
 
 
352
  df2 = df2.set_index("Model").astype(float)
353
 
354
  fig = go.Figure()