hysts HF staff commited on
Commit
7c4bcf7
1 Parent(s): f5348ec

Remove unnecessary table operations

Browse files
Files changed (2) hide show
  1. app.py +0 -23
  2. src/populate.py +0 -2
app.py CHANGED
@@ -167,16 +167,6 @@ def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
167
  unique_columns.append(c)
168
  seen.add(c)
169
 
170
- # 'Model' カラムにリンクを含む形式で再構築
171
- if "Model" in df.columns:
172
- df["Model"] = df["Model"].apply(
173
- lambda x: (
174
- f'[{x.split(">")[-2].split("<")[0]}]({x.split("href=")[1].split(chr(34))[1]})'
175
- if isinstance(x, str) and "href=" in x
176
- else x
177
- )
178
- )
179
-
180
  # フィルタリングされたカラムでデータフレームを作成
181
  filtered_df = df[unique_columns]
182
  return filtered_df
@@ -278,19 +268,6 @@ initial_columns = ["T"] + [
278
  ]
279
  leaderboard_df_filtered = select_columns(leaderboard_df, initial_columns)
280
 
281
- # Model列のリンク形式を修正
282
- leaderboard_df_filtered["Model"] = leaderboard_df_filtered["Model"].apply(
283
- lambda x: (
284
- f'[{x.split(">")[-2].split("<")[0]}]({x.split("href=")[1].split(chr(34))[1]})'
285
- if isinstance(x, str) and "href=" in x
286
- else x
287
- )
288
- )
289
-
290
- # 数値データを文字列に変換
291
- for col in leaderboard_df_filtered.columns:
292
- if col not in ["T", "Model"]:
293
- leaderboard_df_filtered[col] = leaderboard_df_filtered[col].astype(str)
294
 
295
  # Leaderboard demo
296
 
 
167
  unique_columns.append(c)
168
  seen.add(c)
169
 
 
 
 
 
 
 
 
 
 
 
170
  # フィルタリングされたカラムでデータフレームを作成
171
  filtered_df = df[unique_columns]
172
  return filtered_df
 
268
  ]
269
  leaderboard_df_filtered = select_columns(leaderboard_df, initial_columns)
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  # Leaderboard demo
273
 
src/populate.py CHANGED
@@ -36,8 +36,6 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
36
  # filter out if any of the benchmarks have not been produced
37
  df = df[has_no_nan_values(df, benchmark_cols)]
38
 
39
- df["Model"] = df["Model"].apply(lambda x: f'[{x.split("/")[-1]}]({x})' if isinstance(x, str) else x)
40
-
41
  return df
42
 
43
 
 
36
  # filter out if any of the benchmarks have not been produced
37
  df = df[has_no_nan_values(df, benchmark_cols)]
38
 
 
 
39
  return df
40
 
41