margsli commited on
Commit
151670c
1 Parent(s): ed265cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -347,7 +347,7 @@ acknowledgment_md = """
347
  ### Acknowledgment
348
  """
349
 
350
- def build_demo(elo_results_file, leaderboard_table_file):
351
  text_size = gr.themes.sizes.text_lg
352
 
353
  with gr.Blocks(
@@ -356,7 +356,7 @@ def build_demo(elo_results_file, leaderboard_table_file):
356
  css=block_css,
357
  ) as demo:
358
  leader_components = build_leaderboard_tab(
359
- elo_results_file, leaderboard_table_file, show_plot=True
360
  )
361
  return demo
362
 
@@ -366,13 +366,15 @@ if __name__ == "__main__":
366
  parser.add_argument("--share", action="store_true")
367
  args = parser.parse_args()
368
 
369
- elo_result_files = glob.glob("elo_results_*.pkl")
370
- elo_result_files.sort(key=lambda x: int(x[12:-4]))
371
- elo_result_file = elo_result_files[-1]
 
 
372
 
373
  leaderboard_table_files = glob.glob("leaderboard_table_*.csv")
374
  leaderboard_table_files.sort(key=lambda x: int(x[18:-4]))
375
  leaderboard_table_file = leaderboard_table_files[-1]
376
 
377
- demo = build_demo(elo_result_file, leaderboard_table_file)
378
  demo.launch(share=args.share)
 
347
  ### Acknowledgment
348
  """
349
 
350
+ def build_demo(results_file, leaderboard_table_file):
351
  text_size = gr.themes.sizes.text_lg
352
 
353
  with gr.Blocks(
 
356
  css=block_css,
357
  ) as demo:
358
  leader_components = build_leaderboard_tab(
359
+ results_file, leaderboard_table_file, show_plot=True
360
  )
361
  return demo
362
 
 
366
  parser.add_argument("--share", action="store_true")
367
  args = parser.parse_args()
368
 
369
+ # result_files = glob.glob("results_*.pkl")
370
+ # result_files.sort(key=lambda x: int(x[12:-4]))
371
+ # result_file = result_files[-1]
372
+ result_file = None
373
+
374
 
375
  leaderboard_table_files = glob.glob("leaderboard_table_*.csv")
376
  leaderboard_table_files.sort(key=lambda x: int(x[18:-4]))
377
  leaderboard_table_file = leaderboard_table_files[-1]
378
 
379
+ demo = build_demo(result_file, leaderboard_table_file)
380
  demo.launch(share=args.share)