ThomasSimonini HF staff commited on
Commit
00723e9
1 Parent(s): 99e39f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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(restart_space, 'interval', seconds=3600)
 
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()