zhimin-z commited on
Commit
c7085e8
·
1 Parent(s): 5984077
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -542,6 +542,15 @@ def get_leaderboard_dataframe():
542
  if "Issue Resolved Rate (%)" in df.columns and not df.empty:
543
  df = df.sort_values(by="Issue Resolved Rate (%)", ascending=False).reset_index(drop=True)
544
 
 
 
 
 
 
 
 
 
 
545
  print(f"Final DataFrame shape: {df.shape}")
546
  print("="*60 + "\n")
547
 
 
542
  if "Issue Resolved Rate (%)" in df.columns and not df.empty:
543
  df = df.sort_values(by="Issue Resolved Rate (%)", ascending=False).reset_index(drop=True)
544
 
545
+ # Workaround for gradio_leaderboard bug: single-row tables don't render properly
546
+ # Add a placeholder row when there's only 1 record
547
+ if len(df) == 1:
548
+ placeholder_row = pd.DataFrame([[
549
+ "—", "—", 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0
550
+ ]], columns=df.columns)
551
+ df = pd.concat([df, placeholder_row], ignore_index=True)
552
+ print("Added placeholder row for single-record workaround")
553
+
554
  print(f"Final DataFrame shape: {df.shape}")
555
  print("="*60 + "\n")
556