sh1gechan commited on
Commit
04dee2e
1 Parent(s): afddb33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -23
app.py CHANGED
@@ -295,13 +295,14 @@ with demo:
295
 
296
  initial_columns = [c.name for c in fields(AutoEvalColumn) if c.never_hidden or c.displayed_by_default]
297
  leaderboard_df_filtered = select_columns(leaderboard_df, initial_columns)
298
-
299
 
300
  leaderboard_df_filtered = leaderboard_df_filtered.rename(columns={'T': 'Type_'})
301
-
302
- # 'Type_' カラムのデータ型と内容を確認
303
- print(f"'Type_' カラムのデータ型: {leaderboard_df_filtered['Type_'].dtype}")
304
- print(f"'Type_' カラムのユニーク値: {leaderboard_df_filtered['Type_'].unique()}")
 
 
305
 
306
  # 'Type_' カラムを文字列型に変換
307
  leaderboard_df_filtered['Type_'] = leaderboard_df_filtered['Type_'].astype(str)
@@ -310,30 +311,17 @@ with demo:
310
  datatype_dict = {}
311
  for col in leaderboard_df_filtered.columns:
312
  if col == 'Model':
313
- datatype_dict[col] = "str" # markdownからstrに変更
314
  elif col in TYPES:
315
  datatype_dict[col] = TYPES[col]
316
  else:
317
- datatype_dict[col] = "str" # デフォルトのデータ型
318
-
319
- datatype_dict['Type_'] = "str"
320
 
321
- # 'Type_' 'datatype_dict' に含まれているか確認
322
- if 'Type_' not in datatype_dict:
323
- print("Warning: 'Type_' column not found in TYPES. Setting its datatype to 'str'.")
324
- datatype_dict['Type_'] = "str"
325
 
326
  # デバッグ用出力
327
- print("Datatype dictionary after renaming 'T' to 'Type_':", datatype_dict)
328
- print("Preview of leaderboard_df_filtered after renaming:")
329
- print(leaderboard_df_filtered.head())
330
-
331
- # カラム名を確認してスペースや特殊文字がないか確認
332
- print([f"'{c}'" for c in leaderboard_df_filtered.columns])
333
-
334
- # 'Type_' カラムのデータ型とユニーク値を再確認
335
- print(f"'Type_' カラムのデータ型: {leaderboard_df_filtered['Type_'].dtype}")
336
- print(f"'Type_' カラムのユニーク値: {leaderboard_df_filtered['Type_'].unique()}")
337
 
338
  # Gradio Dataframe コンポーネントの初期化
339
  leaderboard_table = gr.components.Dataframe(
@@ -344,6 +332,10 @@ with demo:
344
  interactive=False,
345
  visible=True,
346
  )
 
 
 
 
347
 
348
 
349
  # Dummy leaderboard for handling the case when the user uses backspace key
 
295
 
296
  initial_columns = [c.name for c in fields(AutoEvalColumn) if c.never_hidden or c.displayed_by_default]
297
  leaderboard_df_filtered = select_columns(leaderboard_df, initial_columns)
 
298
 
299
  leaderboard_df_filtered = leaderboard_df_filtered.rename(columns={'T': 'Type_'})
300
+
301
+ # データフレームの内容を確認
302
+ print("Columns in leaderboard_df_filtered:")
303
+ print(leaderboard_df_filtered.columns)
304
+ print("\nFirst few rows of leaderboard_df_filtered:")
305
+ print(leaderboard_df_filtered.head())
306
 
307
  # 'Type_' カラムを文字列型に変換
308
  leaderboard_df_filtered['Type_'] = leaderboard_df_filtered['Type_'].astype(str)
 
311
  datatype_dict = {}
312
  for col in leaderboard_df_filtered.columns:
313
  if col == 'Model':
314
+ datatype_dict[col] = "str"
315
  elif col in TYPES:
316
  datatype_dict[col] = TYPES[col]
317
  else:
318
+ datatype_dict[col] = "str"
 
 
319
 
320
+ datatype_dict['Type_'] = "str"
 
 
 
321
 
322
  # デバッグ用出力
323
+ print("\nDatatype dictionary:")
324
+ print(datatype_dict)
 
 
 
 
 
 
 
 
325
 
326
  # Gradio Dataframe コンポーネントの初期化
327
  leaderboard_table = gr.components.Dataframe(
 
332
  interactive=False,
333
  visible=True,
334
  )
335
+
336
+ # デバッグ情報の出力
337
+ print("\nLeaderboard table headers:")
338
+ print(leaderboard_table.headers)
339
 
340
 
341
  # Dummy leaderboard for handling the case when the user uses backspace key