Spaces:
Runtime error
Runtime error
Commit
•
00723e9
1
Parent(s):
99e39f3
Update app.py
Browse files
app.py
CHANGED
@@ -288,7 +288,7 @@ def filter_data(rl_env, path, user_id):
|
|
288 |
print(models)
|
289 |
return models
|
290 |
|
291 |
-
run_update_dataset()
|
292 |
|
293 |
with block:
|
294 |
gr.Markdown(f"""
|
@@ -358,10 +358,11 @@ with block:
|
|
358 |
"""
|
359 |
block.launch()
|
360 |
|
361 |
-
|
362 |
scheduler = BackgroundScheduler()
|
363 |
# Refresh every hour
|
364 |
#scheduler.add_job(func=run_update_dataset, trigger="interval", seconds=3600)
|
365 |
#scheduler.add_job(download_leaderboard_dataset, 'interval', seconds=3600)
|
366 |
-
scheduler.add_job(
|
|
|
367 |
scheduler.start()
|
|
|
288 |
print(models)
|
289 |
return models
|
290 |
|
291 |
+
#run_update_dataset()
|
292 |
|
293 |
with block:
|
294 |
gr.Markdown(f"""
|
|
|
358 |
"""
|
359 |
block.launch()
|
360 |
|
361 |
+
# What we do here is to run run_update_dataset every hour and relaunch the machine every 2h
|
362 |
scheduler = BackgroundScheduler()
|
363 |
# Refresh every hour
|
364 |
#scheduler.add_job(func=run_update_dataset, trigger="interval", seconds=3600)
|
365 |
#scheduler.add_job(download_leaderboard_dataset, 'interval', seconds=3600)
|
366 |
+
scheduler.add_job(run_update_dataset, 'interval', seconds=3600)
|
367 |
+
scheduler.add_job(restart_space, 'interval', seconds=7200)
|
368 |
scheduler.start()
|