Fix ReadTimeoutError crash on Space initialization

#2
by aviavi12 - opened
This comment has been hidden

Problem

Space crashes with ReadTimeoutError when loading leaderboard submissions, followed by AssertionError at line 514.

Solution

Added robust error handling for empty/missing leaderboard data:

  • Created get_empty_leaderboard_df() helper function in app.py to return an empty DataFrame with proper column structure
  • Modified refresh_leaderboard_data() to gracefully fall back to empty DataFrame when data is unavailable
  • Updated leaderboard initialization to display a friendly warning message when no data exists
  • Enhanced get_leaderboard_df() in populate.py to handle missing datasets and "default-only" configs by returning empty DataFrame instead of crashing
aviavi12 changed pull request status to open
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment