Spaces:
AIR-Bench
/
Running on CPU Upgrade

nan commited on
Commit
7a743dd
1 Parent(s): e9203ff

fix: unify the slug naming

Browse files
Files changed (3) hide show
  1. src/benchmarks.py +2 -2
  2. src/loaders.py +2 -5
  3. src/utils.py +1 -2
src/benchmarks.py CHANGED
@@ -55,14 +55,14 @@ def get_benchmarks_enum(benchmark_version: str, task_type: TaskType):
55
 
56
  _qa_benchmark_dict = {}
57
  for version in BENCHMARK_VERSION_LIST:
58
- safe_version_name = get_safe_name(version)[-4:]
59
  _qa_benchmark_dict[safe_version_name] = Enum(
60
  f"QABenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.qa)
61
  )
62
 
63
  _doc_benchmark_dict = {}
64
  for version in BENCHMARK_VERSION_LIST:
65
- safe_version_name = get_safe_name(version)[-4:]
66
  _doc_benchmark_dict[safe_version_name] = Enum(
67
  f"LongDocBenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.long_doc)
68
  )
 
55
 
56
  _qa_benchmark_dict = {}
57
  for version in BENCHMARK_VERSION_LIST:
58
+ safe_version_name = get_safe_name(version)
59
  _qa_benchmark_dict[safe_version_name] = Enum(
60
  f"QABenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.qa)
61
  )
62
 
63
  _doc_benchmark_dict = {}
64
  for version in BENCHMARK_VERSION_LIST:
65
+ safe_version_name = get_safe_name(version)
66
  _doc_benchmark_dict[safe_version_name] = Enum(
67
  f"LongDocBenchmarks_{safe_version_name}", get_benchmarks_enum(version, TaskType.long_doc)
68
  )
src/loaders.py CHANGED
@@ -51,8 +51,7 @@ def load_raw_eval_results(results_path: str) -> List[FullEvalResult]:
51
 
52
 
53
  def load_leaderboard_datastore(file_path, version) -> LeaderboardDataStore:
54
- slug = get_safe_name(version)[-4:]
55
- ds = LeaderboardDataStore(version, slug, None, None, None, None, None, None, None, None)
56
  ds.raw_data = load_raw_eval_results(file_path)
57
  print(f"raw data: {len(ds.raw_data)}")
58
 
@@ -70,9 +69,7 @@ def load_leaderboard_datastore(file_path, version) -> LeaderboardDataStore:
70
  ds.doc_fmt_df = ds.doc_fmt_df[~ds.doc_fmt_df[COL_NAME_IS_ANONYMOUS]][doc_cols]
71
  ds.doc_fmt_df.drop([COL_NAME_REVISION, COL_NAME_TIMESTAMP], axis=1, inplace=True)
72
 
73
- ds.reranking_models = sorted(
74
- list(frozenset([eval_result.reranking_model for eval_result in ds.raw_data]))
75
- )
76
  return ds
77
 
78
 
 
51
 
52
 
53
  def load_leaderboard_datastore(file_path, version) -> LeaderboardDataStore:
54
+ ds = LeaderboardDataStore(version, get_safe_name(version), None, None, None, None, None, None, None, None)
 
55
  ds.raw_data = load_raw_eval_results(file_path)
56
  print(f"raw data: {len(ds.raw_data)}")
57
 
 
69
  ds.doc_fmt_df = ds.doc_fmt_df[~ds.doc_fmt_df[COL_NAME_IS_ANONYMOUS]][doc_cols]
70
  ds.doc_fmt_df.drop([COL_NAME_REVISION, COL_NAME_TIMESTAMP], axis=1, inplace=True)
71
 
72
+ ds.reranking_models = sorted(list(frozenset([eval_result.reranking_model for eval_result in ds.raw_data])))
 
 
73
  return ds
74
 
75
 
src/utils.py CHANGED
@@ -145,13 +145,12 @@ def _update_df_elem(
145
  reset_ranking: bool = True,
146
  show_revision_and_timestamp: bool = False,
147
  ):
148
- version_slug = get_safe_name(version)[-4:]
149
  filtered_df = source_df.copy()
150
  if not show_anonymous:
151
  filtered_df = filtered_df[~filtered_df[COL_NAME_IS_ANONYMOUS]]
152
  filtered_df = filter_models(filtered_df, reranking_query)
153
  filtered_df = filter_queries(query, filtered_df)
154
- filtered_df = select_columns(filtered_df, domains, langs, task, reset_ranking, version_slug)
155
  if not show_revision_and_timestamp:
156
  filtered_df.drop([COL_NAME_REVISION, COL_NAME_TIMESTAMP], axis=1, inplace=True)
157
  return filtered_df
 
145
  reset_ranking: bool = True,
146
  show_revision_and_timestamp: bool = False,
147
  ):
 
148
  filtered_df = source_df.copy()
149
  if not show_anonymous:
150
  filtered_df = filtered_df[~filtered_df[COL_NAME_IS_ANONYMOUS]]
151
  filtered_df = filter_models(filtered_df, reranking_query)
152
  filtered_df = filter_queries(query, filtered_df)
153
+ filtered_df = select_columns(filtered_df, domains, langs, task, reset_ranking, get_safe_name(version))
154
  if not show_revision_and_timestamp:
155
  filtered_df.drop([COL_NAME_REVISION, COL_NAME_TIMESTAMP], axis=1, inplace=True)
156
  return filtered_df