Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
•
f9c697f
1
Parent(s):
f62b52e
fixing the loading of leaderboard dataframe component
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ def download_dataset(repo_id, local_dir, repo_type="dataset", max_attempts=3, ba
|
|
93 |
def get_latest_data_leaderboard(leaderboard_initial_df):
|
94 |
current_time = datetime.datetime.now()
|
95 |
global LAST_UPDATE_LEADERBOARD
|
96 |
-
if current_time - LAST_UPDATE_LEADERBOARD < datetime.timedelta(minutes=10):
|
97 |
return leaderboard_initial_df
|
98 |
LAST_UPDATE_LEADERBOARD = current_time
|
99 |
leaderboard_dataset = datasets.load_dataset(
|
@@ -127,7 +127,7 @@ def init_space():
|
|
127 |
restart_space()
|
128 |
|
129 |
# Always redownload the leaderboard DataFrame
|
130 |
-
leaderboard_df = get_latest_data_leaderboard()
|
131 |
|
132 |
# Evaluation queue DataFrame retrieval is independent of initialization detail level
|
133 |
eval_queue_dfs = get_latest_data_queue()
|
|
|
93 |
def get_latest_data_leaderboard(leaderboard_initial_df):
|
94 |
current_time = datetime.datetime.now()
|
95 |
global LAST_UPDATE_LEADERBOARD
|
96 |
+
if current_time - LAST_UPDATE_LEADERBOARD < datetime.timedelta(minutes=10) and leaderboard_initial_df is not None:
|
97 |
return leaderboard_initial_df
|
98 |
LAST_UPDATE_LEADERBOARD = current_time
|
99 |
leaderboard_dataset = datasets.load_dataset(
|
|
|
127 |
restart_space()
|
128 |
|
129 |
# Always redownload the leaderboard DataFrame
|
130 |
+
leaderboard_df = get_latest_data_leaderboard(None)
|
131 |
|
132 |
# Evaluation queue DataFrame retrieval is independent of initialization detail level
|
133 |
eval_queue_dfs = get_latest_data_queue()
|