MedGRPO Team commited on
Commit
4a199ff
Β·
1 Parent(s): 18339c0
Files changed (2) hide show
  1. .gitignore +6 -1
  2. app.py +13 -6
.gitignore CHANGED
@@ -13,4 +13,9 @@ eval-results-bk/
13
  logs/
14
  .gradio/
15
  data/*.json
16
- cache/
 
 
 
 
 
 
13
  logs/
14
  .gradio/
15
  data/*.json
16
+ cache/
17
+
18
+ # User submission data - DO NOT commit (will lose user data)
19
+ leaderboard.json
20
+ submissions/
21
+ results/
app.py CHANGED
@@ -61,10 +61,13 @@ def load_ground_truth():
61
  "Ground truth not found. Please set HF_TOKEN secret or provide local file."
62
  )
63
 
64
- # Configuration
65
- SUBMISSIONS_DIR = Path("submissions")
66
- RESULTS_DIR = Path("results")
67
- LEADERBOARD_FILE = Path("leaderboard.json")
 
 
 
68
  EVAL_SCRIPT = Path("evaluation/evaluate_all_pai.py") # Local copy in repo
69
 
70
  # Ensure directories exist
@@ -1044,9 +1047,13 @@ with gr.Blocks(title="MedVidBench Leaderboard", theme=gr.themes.Soft()) as demo:
1044
  with gr.Tab("πŸ† Leaderboard"):
1045
  gr.Markdown("### Current Rankings")
1046
 
 
 
 
1047
  leaderboard_table = gr.Dataframe(
1048
- value=format_leaderboard_display(load_leaderboard()),
1049
- interactive=False
 
1050
  )
1051
 
1052
  refresh_btn = gr.Button("πŸ”„ Refresh Leaderboard", size="sm")
 
61
  "Ground truth not found. Please set HF_TOKEN secret or provide local file."
62
  )
63
 
64
+ # Configuration - Use persistent storage on HuggingFace Spaces
65
+ # On HF Spaces, /data is persistent across app updates
66
+ PERSISTENT_DIR = Path("/data") if Path("/data").exists() else Path(".")
67
+
68
+ SUBMISSIONS_DIR = PERSISTENT_DIR / "submissions"
69
+ RESULTS_DIR = PERSISTENT_DIR / "results"
70
+ LEADERBOARD_FILE = PERSISTENT_DIR / "leaderboard.json"
71
  EVAL_SCRIPT = Path("evaluation/evaluate_all_pai.py") # Local copy in repo
72
 
73
  # Ensure directories exist
 
1047
  with gr.Tab("πŸ† Leaderboard"):
1048
  gr.Markdown("### Current Rankings")
1049
 
1050
+ # Load initial leaderboard data
1051
+ initial_leaderboard = format_leaderboard_display(load_leaderboard())
1052
+
1053
  leaderboard_table = gr.Dataframe(
1054
+ value=initial_leaderboard,
1055
+ interactive=False,
1056
+ wrap=True # Enable text wrapping for better display
1057
  )
1058
 
1059
  refresh_btn = gr.Button("πŸ”„ Refresh Leaderboard", size="sm")