Automatically refresh the leaderboard when loading the space

#8
by osanseviero - opened
Files changed (1) hide show
  1. app.py +1 -14
app.py CHANGED
@@ -251,19 +251,6 @@ We chose these benchmarks as they test a variety of reasoning and general knowle
251
  submit_button = gr.Button("Submit Eval")
252
  submit_button.click(add_new_eval, [model_name_textbox, base_model_name_textbox, revision_name_textbox, is_8bit_toggle, private, is_delta_weight])
253
 
254
-
255
-
256
-
257
-
258
-
259
- print("adding refresh leaderboard")
260
- def refresh_leaderboard():
261
- leaderboard_table = get_leaderboard()
262
- eval_table = get_eval_table()
263
- print("refreshing leaderboard")
264
-
265
- scheduler = BackgroundScheduler()
266
- scheduler.add_job(func=refresh_leaderboard, trigger="interval", seconds=300) # refresh every 5 mins
267
- scheduler.start()
268
 
 
269
  block.launch()
 
251
  submit_button = gr.Button("Submit Eval")
252
  submit_button.click(add_new_eval, [model_name_textbox, base_model_name_textbox, revision_name_textbox, is_8bit_toggle, private, is_delta_weight])
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
255
+ block.load(refresh, inputs=[], outputs=[leaderboard_table, eval_table])
256
  block.launch()