Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,20 +36,35 @@ def restart_space():
|
|
36 |
try:
|
37 |
print(EVAL_REQUESTS_PATH)
|
38 |
snapshot_download(
|
39 |
-
repo_id=QUEUE_REPO,
|
|
|
|
|
|
|
|
|
|
|
40 |
)
|
41 |
except Exception:
|
42 |
restart_space()
|
43 |
try:
|
44 |
print(EVAL_RESULTS_PATH)
|
45 |
snapshot_download(
|
46 |
-
repo_id=RESULTS_REPO,
|
|
|
|
|
|
|
|
|
|
|
47 |
)
|
48 |
except Exception:
|
49 |
restart_space()
|
50 |
|
51 |
|
52 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
(
|
55 |
finished_eval_queue_df,
|
@@ -88,6 +103,12 @@ def init_leaderboard(dataframe):
|
|
88 |
interactive=False,
|
89 |
)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
demo = gr.Blocks(css=custom_css)
|
93 |
with demo:
|
@@ -149,10 +170,7 @@ with demo:
|
|
149 |
model_name_textbox = gr.Textbox(label="Model name")
|
150 |
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
151 |
model_type = gr.Dropdown(
|
152 |
-
choices=[
|
153 |
-
("Korean Bar Exam (Lawyer)" if t.to_str(" : ") == "ANLI" else t.to_str(" : "))
|
154 |
-
for t in ModelType if t != ModelType.Unknown
|
155 |
-
],
|
156 |
label="Model type",
|
157 |
multiselect=False,
|
158 |
value=None,
|
|
|
36 |
try:
|
37 |
print(EVAL_REQUESTS_PATH)
|
38 |
snapshot_download(
|
39 |
+
repo_id=QUEUE_REPO,
|
40 |
+
local_dir=EVAL_REQUESTS_PATH,
|
41 |
+
repo_type="dataset",
|
42 |
+
tqdm_class=None,
|
43 |
+
etag_timeout=30,
|
44 |
+
token=TOKEN
|
45 |
)
|
46 |
except Exception:
|
47 |
restart_space()
|
48 |
try:
|
49 |
print(EVAL_RESULTS_PATH)
|
50 |
snapshot_download(
|
51 |
+
repo_id=RESULTS_REPO,
|
52 |
+
local_dir=EVAL_RESULTS_PATH,
|
53 |
+
repo_type="dataset",
|
54 |
+
tqdm_class=None,
|
55 |
+
etag_timeout=30,
|
56 |
+
token=TOKEN
|
57 |
)
|
58 |
except Exception:
|
59 |
restart_space()
|
60 |
|
61 |
|
62 |
LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
63 |
+
# Replace benchmark names in the leaderboard DataFrame
|
64 |
+
LEADERBOARD_DF.replace(
|
65 |
+
{"ANLI": "Korean Bar Exam (Lawyer)", "LogiQA": "Senior Civil Service Examination(국가직 5급)"},
|
66 |
+
inplace=True,
|
67 |
+
)
|
68 |
|
69 |
(
|
70 |
finished_eval_queue_df,
|
|
|
103 |
interactive=False,
|
104 |
)
|
105 |
|
106 |
+
def transform_model_type(s):
|
107 |
+
if s == "ANLI":
|
108 |
+
return "Korean Bar Exam (Lawyer)"
|
109 |
+
elif s == "LogiQA":
|
110 |
+
return "Senior Civil Service Examination(국가직 5급)"
|
111 |
+
return s
|
112 |
|
113 |
demo = gr.Blocks(css=custom_css)
|
114 |
with demo:
|
|
|
170 |
model_name_textbox = gr.Textbox(label="Model name")
|
171 |
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
172 |
model_type = gr.Dropdown(
|
173 |
+
choices=[transform_model_type(t.to_str(" : ")) for t in ModelType if t != ModelType.Unknown],
|
|
|
|
|
|
|
174 |
label="Model type",
|
175 |
multiselect=False,
|
176 |
value=None,
|