Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: fix the bug in loading hidden df
Browse files- app.py +16 -73
- src/utils.py +0 -3
app.py
CHANGED
@@ -22,14 +22,14 @@ def restart_space():
|
|
22 |
|
23 |
|
24 |
|
25 |
-
try:
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
except Exception as e:
|
31 |
-
|
32 |
-
|
33 |
|
34 |
raw_data = get_raw_eval_results(f"{EVAL_RESULTS_PATH}/AIR-Bench_24.04")
|
35 |
|
@@ -79,30 +79,6 @@ def update_metric_long_doc(
|
|
79 |
return update_metric(raw_data, "long-doc", metric, domains, langs, reranking_model, query, show_anonymous, show_revision_and_timestamp)
|
80 |
|
81 |
|
82 |
-
def update_table_without_ranking(
|
83 |
-
hidden_df,
|
84 |
-
domains,
|
85 |
-
langs,
|
86 |
-
reranking_query,
|
87 |
-
query,
|
88 |
-
show_anonymous,
|
89 |
-
show_revision_and_timestamp,
|
90 |
-
):
|
91 |
-
return update_table(hidden_df, domains, langs, reranking_query, query, show_anonymous, reset_ranking=False, show_revision_and_timestamp=show_revision_and_timestamp)
|
92 |
-
|
93 |
-
|
94 |
-
def update_table_without_ranking_long_doc(
|
95 |
-
hidden_df,
|
96 |
-
domains,
|
97 |
-
langs,
|
98 |
-
reranking_query,
|
99 |
-
query,
|
100 |
-
show_anonymous,
|
101 |
-
show_revision_and_timestamp,
|
102 |
-
):
|
103 |
-
return update_table_long_doc(hidden_df, domains, langs, reranking_query, query, show_anonymous, reset_ranking=False, show_revision_and_timestamp=show_revision_and_timestamp)
|
104 |
-
|
105 |
-
|
106 |
demo = gr.Blocks(css=custom_css)
|
107 |
with demo:
|
108 |
gr.HTML(TITLE)
|
@@ -139,8 +115,7 @@ with demo:
|
|
139 |
multiselect=True
|
140 |
)
|
141 |
with gr.Row():
|
142 |
-
select_noreranker_only_btn = gr.
|
143 |
-
selected_rerankings,
|
144 |
value="Only show results without ranking models",
|
145 |
)
|
146 |
|
@@ -202,7 +177,7 @@ with demo:
|
|
202 |
|
203 |
# Set search_bar listener
|
204 |
search_bar.submit(
|
205 |
-
|
206 |
[
|
207 |
hidden_leaderboard_table_for_search,
|
208 |
selected_domains,
|
@@ -214,25 +189,9 @@ with demo:
|
|
214 |
leaderboard_table,
|
215 |
)
|
216 |
|
217 |
-
for selector in [show_revision_and_timestamp, selected_rerankings]:
|
218 |
-
selector.change(
|
219 |
-
update_table_without_ranking,
|
220 |
-
[
|
221 |
-
hidden_leaderboard_table_for_search,
|
222 |
-
selected_domains,
|
223 |
-
selected_langs,
|
224 |
-
selected_rerankings,
|
225 |
-
search_bar,
|
226 |
-
show_anonymous,
|
227 |
-
show_revision_and_timestamp
|
228 |
-
],
|
229 |
-
leaderboard_table,
|
230 |
-
queue=True
|
231 |
-
)
|
232 |
-
|
233 |
# Set column-wise listener
|
234 |
for selector in [
|
235 |
-
selected_domains, selected_langs, show_anonymous
|
236 |
]:
|
237 |
selector.change(
|
238 |
update_table,
|
@@ -282,7 +241,8 @@ with demo:
|
|
282 |
with gr.Row():
|
283 |
search_bar = gr.Textbox(
|
284 |
info="Search the retrieval methods",
|
285 |
-
placeholder=" 🔍 Search for retrieval methods (separate multiple queries with `;`)
|
|
|
286 |
show_label=False,
|
287 |
elem_id="search-bar-long-doc",
|
288 |
)
|
@@ -298,8 +258,7 @@ with demo:
|
|
298 |
multiselect=True,
|
299 |
)
|
300 |
with gr.Row():
|
301 |
-
select_noreranker_only_btn = gr.
|
302 |
-
selected_rerankings,
|
303 |
value="Only show results without ranking models",
|
304 |
)
|
305 |
with gr.Column(min_width=320):
|
@@ -361,7 +320,7 @@ with demo:
|
|
361 |
|
362 |
# Set search_bar listener
|
363 |
search_bar.submit(
|
364 |
-
|
365 |
[
|
366 |
hidden_leaderboard_table_for_search,
|
367 |
selected_domains,
|
@@ -374,25 +333,9 @@ with demo:
|
|
374 |
leaderboard_table_long_doc,
|
375 |
)
|
376 |
|
377 |
-
for selector in [show_revision_and_timestamp, selected_rerankings]:
|
378 |
-
selector.change(
|
379 |
-
update_table_without_ranking_long_doc,
|
380 |
-
[
|
381 |
-
hidden_leaderboard_table_for_search,
|
382 |
-
selected_domains,
|
383 |
-
selected_langs,
|
384 |
-
selected_rerankings,
|
385 |
-
search_bar,
|
386 |
-
show_anonymous,
|
387 |
-
show_revision_and_timestamp
|
388 |
-
],
|
389 |
-
leaderboard_table_long_doc,
|
390 |
-
queue=True,
|
391 |
-
)
|
392 |
-
|
393 |
# Set column-wise listener
|
394 |
for selector in [
|
395 |
-
selected_domains, selected_langs, show_anonymous
|
396 |
]:
|
397 |
selector.change(
|
398 |
update_table_long_doc,
|
|
|
22 |
|
23 |
|
24 |
|
25 |
+
# try:
|
26 |
+
# snapshot_download(
|
27 |
+
# repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30,
|
28 |
+
# token=TOKEN
|
29 |
+
# )
|
30 |
+
# except Exception as e:
|
31 |
+
# print(f'failed to download')
|
32 |
+
# restart_space()
|
33 |
|
34 |
raw_data = get_raw_eval_results(f"{EVAL_RESULTS_PATH}/AIR-Bench_24.04")
|
35 |
|
|
|
79 |
return update_metric(raw_data, "long-doc", metric, domains, langs, reranking_model, query, show_anonymous, show_revision_and_timestamp)
|
80 |
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
demo = gr.Blocks(css=custom_css)
|
83 |
with demo:
|
84 |
gr.HTML(TITLE)
|
|
|
115 |
multiselect=True
|
116 |
)
|
117 |
with gr.Row():
|
118 |
+
select_noreranker_only_btn = gr.Button(
|
|
|
119 |
value="Only show results without ranking models",
|
120 |
)
|
121 |
|
|
|
177 |
|
178 |
# Set search_bar listener
|
179 |
search_bar.submit(
|
180 |
+
update_table,
|
181 |
[
|
182 |
hidden_leaderboard_table_for_search,
|
183 |
selected_domains,
|
|
|
189 |
leaderboard_table,
|
190 |
)
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
# Set column-wise listener
|
193 |
for selector in [
|
194 |
+
selected_domains, selected_langs, show_anonymous, show_revision_and_timestamp, selected_rerankings
|
195 |
]:
|
196 |
selector.change(
|
197 |
update_table,
|
|
|
241 |
with gr.Row():
|
242 |
search_bar = gr.Textbox(
|
243 |
info="Search the retrieval methods",
|
244 |
+
placeholder=" 🔍 Search for retrieval methods (separate multiple queries with `;`)"
|
245 |
+
" and press ENTER...",
|
246 |
show_label=False,
|
247 |
elem_id="search-bar-long-doc",
|
248 |
)
|
|
|
258 |
multiselect=True,
|
259 |
)
|
260 |
with gr.Row():
|
261 |
+
select_noreranker_only_btn = gr.Button(
|
|
|
262 |
value="Only show results without ranking models",
|
263 |
)
|
264 |
with gr.Column(min_width=320):
|
|
|
320 |
|
321 |
# Set search_bar listener
|
322 |
search_bar.submit(
|
323 |
+
update_table_long_doc,
|
324 |
[
|
325 |
hidden_leaderboard_table_for_search,
|
326 |
selected_domains,
|
|
|
333 |
leaderboard_table_long_doc,
|
334 |
)
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
# Set column-wise listener
|
337 |
for selector in [
|
338 |
+
selected_domains, selected_langs, show_anonymous, show_revision_and_timestamp, selected_rerankings
|
339 |
]:
|
340 |
selector.change(
|
341 |
update_table_long_doc,
|
src/utils.py
CHANGED
@@ -218,9 +218,6 @@ def upload_file(filepath: str):
|
|
218 |
return filepath
|
219 |
|
220 |
|
221 |
-
from huggingface_hub import ModelCard
|
222 |
-
from huggingface_hub.utils import EntryNotFoundError
|
223 |
-
|
224 |
|
225 |
def get_iso_format_timestamp():
|
226 |
# Get the current timestamp with UTC as the timezone
|
|
|
218 |
return filepath
|
219 |
|
220 |
|
|
|
|
|
|
|
221 |
|
222 |
def get_iso_format_timestamp():
|
223 |
# Get the current timestamp with UTC as the timezone
|