djstrong commited on
Commit
c02e12a
1 Parent(s): d879a1e
Files changed (2) hide show
  1. src/display/utils.py +1 -0
  2. src/populate.py +3 -0
src/display/utils.py CHANGED
@@ -52,6 +52,7 @@ auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Avai
52
  auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, False)])
53
  # Dummy column for the search bar (hidden by the custom CSS)
54
  auto_eval_column_dict.append(["dummy", ColumnContent, ColumnContent("model_name_for_query", "str", False, dummy=True)])
 
55
 
56
  # We use make dataclass to dynamically fill the scores from Tasks
57
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
 
52
  auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, False)])
53
  # Dummy column for the search bar (hidden by the custom CSS)
54
  auto_eval_column_dict.append(["dummy", ColumnContent, ColumnContent("model_name_for_query", "str", False, dummy=True)])
55
+ auto_eval_column_dict.append(["rank", ColumnContent, ColumnContent("rank", "number", True)])
56
 
57
  # We use make dataclass to dynamically fill the scores from Tasks
58
  AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
src/populate.py CHANGED
@@ -18,6 +18,9 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
18
  df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
19
  df = df[cols].round(decimals=2)
20
 
 
 
 
21
  # filter out if any of the benchmarks have not been produced
22
  #df2 = df[has_no_nan_values(df, benchmark_cols)]
23
  return raw_data, df
 
18
  df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
19
  df = df[cols].round(decimals=2)
20
 
21
+ # add column rank to df
22
+ df["rank"] = df[AutoEvalColumn.average.name].rank(ascending=False, method="min")
23
+
24
  # filter out if any of the benchmarks have not been produced
25
  #df2 = df[has_no_nan_values(df, benchmark_cols)]
26
  return raw_data, df