sh1gechan commited on
Commit
87f7dc5
1 Parent(s): 879a221

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -168,7 +168,7 @@ def filter_models(
168
 
169
  # モデルサイズでフィルタリング
170
  if "Unknown" in size_query:
171
- size_mask = filtered_df[AutoEvalColumn.params.name].isna() | (filtered_df[AutoEvalColumn.params.name] == "Unknown")
172
  else:
173
  numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query if s != "Unknown"]))
174
  params_column = pd.to_numeric(filtered_df[AutoEvalColumn.params.name], errors="coerce")
@@ -266,10 +266,10 @@ with demo:
266
  leaderboard_df_filtered = filter_models(leaderboard_df, [t.to_str(" ") for t in ModelType], list(NUMERIC_INTERVALS.keys()), [i.value.name for i in Precision], [i.value.name for i in AddSpecialTokens], [i.value.name for i in NumFewShots], False, False, False)
267
 
268
  # 列名の重複を解消
269
- leaderboard_df_filtered.columns = pd.io.parsers.readers._maybe_dedup_names(leaderboard_df_filtered.columns)
270
 
271
  leaderboard_table = gr.components.Dataframe(
272
- value=leaderboard_df_filtered,
273
  headers=list(leaderboard_df_filtered.columns),
274
  datatype={col: "str" for col in leaderboard_df_filtered.columns},
275
  elem_id="leaderboard-table",
@@ -277,8 +277,8 @@ with demo:
277
  visible=True,
278
  )
279
  print("Leaderboard table initial value:")
280
- print(leaderboard_table.value)
281
- print(f"Leaderboard table shape: {leaderboard_table.value.shape if isinstance(leaderboard_table.value, pd.DataFrame) else len(leaderboard_table.value)}")
282
 
283
  # Dummy leaderboard for handling the case when the user uses backspace key
284
  hidden_leaderboard_table_for_search = gr.components.Dataframe(
 
168
 
169
  # モデルサイズでフィルタリング
170
  if "Unknown" in size_query:
171
+ size_mask = filtered_df[AutoEvalColumn.params.name].isna() | (filtered_df[AutoEvalColumn.params.name].astype(str).isin(["Unknown", "?"]))
172
  else:
173
  numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query if s != "Unknown"]))
174
  params_column = pd.to_numeric(filtered_df[AutoEvalColumn.params.name], errors="coerce")
 
266
  leaderboard_df_filtered = filter_models(leaderboard_df, [t.to_str(" ") for t in ModelType], list(NUMERIC_INTERVALS.keys()), [i.value.name for i in Precision], [i.value.name for i in AddSpecialTokens], [i.value.name for i in NumFewShots], False, False, False)
267
 
268
  # 列名の重複を解消
269
+ leaderboard_df_filtered.columns = pd.io.parsers.base._maybe_dedup_names(leaderboard_df_filtered.columns)
270
 
271
  leaderboard_table = gr.components.Dataframe(
272
+ value=leaderboard_df_filtered.to_dict('records'),
273
  headers=list(leaderboard_df_filtered.columns),
274
  datatype={col: "str" for col in leaderboard_df_filtered.columns},
275
  elem_id="leaderboard-table",
 
277
  visible=True,
278
  )
279
  print("Leaderboard table initial value:")
280
+ print(leaderboard_df_filtered)
281
+ print(f"Leaderboard table shape: {leaderboard_df_filtered.shape}")
282
 
283
  # Dummy leaderboard for handling the case when the user uses backspace key
284
  hidden_leaderboard_table_for_search = gr.components.Dataframe(