zhimin-z commited on
Commit
e7e38e7
·
1 Parent(s): 5dc973b
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -455,6 +455,15 @@ def get_leaderboard_dataframe():
455
  if "Total Releases" in df.columns and not df.empty:
456
  df = df.sort_values(by="Total Releases", ascending=False).reset_index(drop=True)
457
 
 
 
 
 
 
 
 
 
 
458
  print(f"Final DataFrame shape: {df.shape}")
459
  print("="*60 + "\n")
460
 
 
455
  if "Total Releases" in df.columns and not df.empty:
456
  df = df.sort_values(by="Total Releases", ascending=False).reset_index(drop=True)
457
 
458
+ # Workaround for gradio_leaderboard bug: single-row tables don't render properly
459
+ # Add a placeholder row when there's only 1 record
460
+ if len(df) == 1:
461
+ placeholder_row = pd.DataFrame([[
462
+ "Submit yours to join!", "—", 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0
463
+ ]], columns=df.columns)
464
+ df = pd.concat([df, placeholder_row], ignore_index=True)
465
+ print("Added placeholder row for single-record workaround")
466
+
467
  print(f"Final DataFrame shape: {df.shape}")
468
  print("="*60 + "\n")
469