ThomasSimonini HF staff commited on
Commit
5dac6c6
β€’
1 Parent(s): 1347af3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -216,6 +216,7 @@ def update_leaderboard_dataset(rl_env, path):
216
 
217
  def download_leaderboard_dataset():
218
  path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
 
219
  return path
220
 
221
  def get_data(rl_env, path) -> pd.DataFrame:
@@ -333,6 +334,7 @@ with block:
333
  env = gr.Variable(rl_env["rl_env"])
334
  grpath = gr.Variable(path_)
335
  with gr.Row():
 
336
  gr_dataframe = gr.components.Dataframe(value=get_data(rl_env["rl_env"], path_), headers=["Ranking πŸ†", "User πŸ€—", "Model id πŸ€–", "Results", "Mean Reward", "Std Reward"], datatype=["number", "markdown", "markdown", "number", "number", "number"], row_count=(100, 'fixed'))
337
 
338
  with gr.Row():
@@ -349,6 +351,14 @@ scheduler.add_job(func=run_update_dataset, trigger="interval", seconds=3600)
349
  scheduler.add_job(download_leaderboard_dataset, 'interval', seconds=3600)
350
  scheduler.start()
351
 
 
 
 
 
 
 
 
 
352
  block.launch()
353
 
354
 
 
216
 
217
  def download_leaderboard_dataset():
218
  path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
219
+ print("PATH DOWNLOAD", path)
220
  return path
221
 
222
  def get_data(rl_env, path) -> pd.DataFrame:
 
334
  env = gr.Variable(rl_env["rl_env"])
335
  grpath = gr.Variable(path_)
336
  with gr.Row():
337
+ print("PATH USED", path_)
338
  gr_dataframe = gr.components.Dataframe(value=get_data(rl_env["rl_env"], path_), headers=["Ranking πŸ†", "User πŸ€—", "Model id πŸ€–", "Results", "Mean Reward", "Std Reward"], datatype=["number", "markdown", "markdown", "number", "number", "number"], row_count=(100, 'fixed'))
339
 
340
  with gr.Row():
 
351
  scheduler.add_job(download_leaderboard_dataset, 'interval', seconds=3600)
352
  scheduler.start()
353
 
354
+ block.load(
355
+ download_leaderboard_dataset,
356
+ inputs=[],
357
+ outputs=[
358
+ path_
359
+ ],
360
+ )
361
+
362
  block.launch()
363
 
364