Spaces:
Building
on
CPU Upgrade
Building
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -323,10 +323,30 @@ with demo:
|
|
323 |
datatype_dict[col] = TYPES[col]
|
324 |
else:
|
325 |
datatype_dict[col] = "str" # デフォルトのデータ型
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
# デバッグ用出力
|
328 |
print("Datatype dictionary:", datatype_dict)
|
329 |
|
|
|
|
|
|
|
|
|
330 |
# Gradio Dataframe コンポーネントの初期化
|
331 |
leaderboard_table = gr.components.Dataframe(
|
332 |
value=leaderboard_df_filtered.to_dict('records'),
|
@@ -336,7 +356,7 @@ with demo:
|
|
336 |
interactive=False,
|
337 |
visible=True,
|
338 |
)
|
339 |
-
|
340 |
print("Datatype dictionary:", datatype_dict)
|
341 |
print("Leaderboard table headers:", leaderboard_table.headers)
|
342 |
|
|
|
323 |
datatype_dict[col] = TYPES[col]
|
324 |
else:
|
325 |
datatype_dict[col] = "str" # デフォルトのデータ型
|
326 |
+
|
327 |
+
# 'T' カラムがすべてのレコードに存在するか確認
|
328 |
+
records = leaderboard_df_filtered.to_dict('records')
|
329 |
+
missing_T_in_records = [i for i, record in enumerate(records) if 'T' not in record]
|
330 |
+
print(f"Number of records missing 'T' key: {len(missing_T_in_records)}")
|
331 |
+
|
332 |
+
if len(missing_T_in_records) > 0:
|
333 |
+
print("Records missing 'T' key:")
|
334 |
+
for i in missing_T_in_records[:5]: # 最初の5件のみ表示
|
335 |
+
print(f"Record {i}: {records[i]}")
|
336 |
+
# 欠損している場合、'T' キーを追加して空文字で埋める
|
337 |
+
for i in missing_T_in_records:
|
338 |
+
records[i]['T'] = ''
|
339 |
+
# データフレームを更新
|
340 |
+
leaderboard_df_filtered = pd.DataFrame(records)
|
341 |
+
|
342 |
|
343 |
# デバッグ用出力
|
344 |
print("Datatype dictionary:", datatype_dict)
|
345 |
|
346 |
+
# デバッグ用にデータフレームの先頭を表示
|
347 |
+
print("Preview of leaderboard_df_filtered:")
|
348 |
+
print(leaderboard_df_filtered.head())
|
349 |
+
|
350 |
# Gradio Dataframe コンポーネントの初期化
|
351 |
leaderboard_table = gr.components.Dataframe(
|
352 |
value=leaderboard_df_filtered.to_dict('records'),
|
|
|
356 |
interactive=False,
|
357 |
visible=True,
|
358 |
)
|
359 |
+
|
360 |
print("Datatype dictionary:", datatype_dict)
|
361 |
print("Leaderboard table headers:", leaderboard_table.headers)
|
362 |
|