sh1gechan commited on
Commit
a616b6e
1 Parent(s): 8f35a3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -172,8 +172,9 @@ def filter_models(
172
  filtered_df = df
173
 
174
  # Model Type フィルタリング
 
175
  type_emoji = [t.split()[0] for t in type_query]
176
- filtered_df = filtered_df[filtered_df['T'].isin(type_emoji)]
177
  print(f"After type filter: {filtered_df.shape}")
178
 
179
  # Precision フィルタリング
@@ -395,10 +396,15 @@ with demo:
395
  print(f"'Type_' カラムのデータ型: {leaderboard_df_filtered['Type_'].dtype}")
396
  print(f"'Type_' カラムのユニーク値: {leaderboard_df_filtered['Type_'].unique()}")
397
 
398
- # Gradio Dataframe コンポーネントの初期化(datatype を省略)
 
 
 
 
399
  leaderboard_table = gr.components.Dataframe(
400
  value=leaderboard_df_filtered,
401
- # datatype=datatype_dict, # 一時的にコメントアウト
 
402
  elem_id="leaderboard-table",
403
  interactive=False,
404
  visible=True,
 
172
  filtered_df = df
173
 
174
  # Model Type フィルタリング
175
+ type_column = 'T' if 'T' in df.columns else 'Type_'
176
  type_emoji = [t.split()[0] for t in type_query]
177
+ filtered_df = df[df[type_column].isin(type_emoji)]
178
  print(f"After type filter: {filtered_df.shape}")
179
 
180
  # Precision フィルタリング
 
396
  print(f"'Type_' カラムのデータ型: {leaderboard_df_filtered['Type_'].dtype}")
397
  print(f"'Type_' カラムのユニーク値: {leaderboard_df_filtered['Type_'].unique()}")
398
 
399
+ datatype = {col: "str" for col in leaderboard_df_filtered.columns}
400
+ datatype['Model'] = "markdown"
401
+ type_column = 'T' if 'T' in leaderboard_df_filtered.columns else 'Type_'
402
+ datatype[type_column] = "str"
403
+
404
  leaderboard_table = gr.components.Dataframe(
405
  value=leaderboard_df_filtered,
406
+ headers=list(leaderboard_df_filtered.columns),
407
+ datatype=datatype,
408
  elem_id="leaderboard-table",
409
  interactive=False,
410
  visible=True,