Sakalti commited on
Commit
75a304d
ยท
verified ยท
1 Parent(s): 08763bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -4,19 +4,6 @@ import pandas as pd
4
  from apscheduler.schedulers.background import BackgroundScheduler
5
  from huggingface_hub import snapshot_download
6
 
7
-
8
- LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
9
-
10
- # ่ฟฝๅŠ : ๅˆ—ๅใ‚’่กจ็คบ
11
- print(LEADERBOARD_DF.columns)
12
-
13
- # ๆ—ขๅญ˜ใฎใ‚ณใƒผใƒ‰
14
- (
15
- finished_eval_queue_df,
16
- running_eval_queue_df,
17
- pending_eval_queue_df,
18
- ) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
19
-
20
  from src.about import (
21
  CITATION_BUTTON_LABEL,
22
  CITATION_BUTTON_TEXT,
@@ -38,10 +25,9 @@ from src.display.utils import (
38
  Precision
39
  )
40
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
41
- from src.populate import get_evaluation_queue_df, get_leaderboard_df
42
  from src.submission.submit import add_new_eval
43
 
44
-
45
  def restart_space():
46
  API.restart_space(repo_id=REPO_ID)
47
 
@@ -61,8 +47,16 @@ try:
61
  except Exception:
62
  restart_space()
63
 
 
 
 
 
 
 
 
 
64
 
65
- LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
66
 
67
  (
68
  finished_eval_queue_df,
@@ -101,7 +95,6 @@ def init_leaderboard(dataframe):
101
  interactive=False,
102
  )
103
 
104
-
105
  demo = gr.Blocks(css=custom_css)
106
  with demo:
107
  gr.HTML(TITLE)
@@ -202,7 +195,7 @@ with demo:
202
  )
203
 
204
  with gr.Row():
205
- with gr.Accordion("๐Ÿ“™ Citation", open=False):
206
  citation_button = gr.Textbox(
207
  value=CITATION_BUTTON_TEXT,
208
  label=CITATION_BUTTON_LABEL,
 
4
  from apscheduler.schedulers.background import BackgroundScheduler
5
  from huggingface_hub import snapshot_download
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  from src.about import (
8
  CITATION_BUTTON_LABEL,
9
  CITATION_BUTTON_TEXT,
 
25
  Precision
26
  )
27
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
28
+ from src.populate import get_leaderboard_df
29
  from src.submission.submit import add_new_eval
30
 
 
31
  def restart_space():
32
  API.restart_space(repo_id=REPO_ID)
33
 
 
47
  except Exception:
48
  restart_space()
49
 
50
+ # ใƒ‡ใƒผใ‚ฟใƒ•ใƒฌใƒผใƒ ใฎ็ขบ่ชใ‚’่ฟฝๅŠ 
51
+ def get_leaderboard_df_with_print(eval_results_path, eval_requests_path, cols, benchmark_cols):
52
+ LEADERBOARD_DF = get_leaderboard_df(eval_results_path, eval_requests_path, cols, benchmark_cols)
53
+
54
+ # ๅˆ—ๅใ‚’่กจ็คบ
55
+ print("LEADERBOARD_DF Columns:", LEADERBOARD_DF.columns)
56
+
57
+ return LEADERBOARD_DF
58
 
59
+ LEADERBOARD_DF = get_leaderboard_df_with_print(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
60
 
61
  (
62
  finished_eval_queue_df,
 
95
  interactive=False,
96
  )
97
 
 
98
  demo = gr.Blocks(css=custom_css)
99
  with demo:
100
  gr.HTML(TITLE)
 
195
  )
196
 
197
  with gr.Row():
198
+ with gr.Accordion("CppObject", open=False):
199
  citation_button = gr.Textbox(
200
  value=CITATION_BUTTON_TEXT,
201
  label=CITATION_BUTTON_LABEL,