Spaces:
Runtime error
Fix leaderboard auto-refresh with gr.Timer + demo.load (new results don't appear until Space restart)
New results never appear on the leaderboard until the Space restarts โ e.g. the 2026-07-05 geometrical submissions are in constellaration-bench-results but missing from the UI (reported in #5).
Cause: Leaderboard(value=get_leaderboard(), every=60) evaluates the function once at container startup and passes a static DataFrame, so every=60 has nothing to re-run โ the table is a snapshot of the last restart.
Fix: keep the concrete initial value (gradio_leaderboard requires one โ its __init__ reads value.columns, so a callable crashes) and refresh via events:
demo.load(get_leaderboard, outputs=leaderboard_table)โ fresh data on every page opengr.Timer(60).tick(get_leaderboard, outputs=leaderboard_table)โ periodic refresh while the tab is open (replacesevery=60)
Testing done
gradio 5.50.0 + gradio-leaderboard 0.0.14 (what the unpinned requirements resolve to today), harness reproducing this exact Leaderboard block against the live results dataset, get_leaderboard instrumented to log calls.
| Case | Result |
|---|---|
main shape: static value + every=60 |
constructs; get_leaderboard runs once and never again โ bug reproduced |
callable value=get_leaderboard (first commit, reverted) |
crashes at construction: AttributeError: 'function' object has no attribute 'columns' (leaderboard.py:128) |
PR head: demo.load + Timer(60) |
renders; fresh fetch on every page open โ one refresh picked up a submission that landed in the dataset mid-test (110 โ 111 rows) |
Not directly observed: a periodic tick (test tab was never foreground-visible and Gradio pauses timers for hidden tabs; the tick shares its event wiring with the verified demo.load). Untouched/untested: Docker build, Submit and Visualize tabs.