Spaces:
Runtime error
Runtime error
Clémentine
commited on
Commit
•
dbb8b5d
1
Parent(s):
8cc38c3
update plot to only look at correct models
Browse files- app.py +23 -22
- src/tools/plots.py +3 -1
app.py
CHANGED
@@ -45,28 +45,29 @@ def restart_space():
|
|
45 |
API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
|
46 |
|
47 |
|
48 |
-
def init_space():
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
|
72 |
raw_data, original_df = get_leaderboard_df(
|
|
|
45 |
API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
|
46 |
|
47 |
|
48 |
+
def init_space(full_init: bool = True):
|
49 |
+
if full_init:
|
50 |
+
try:
|
51 |
+
print(EVAL_REQUESTS_PATH)
|
52 |
+
snapshot_download(
|
53 |
+
repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
|
54 |
+
)
|
55 |
+
except Exception:
|
56 |
+
restart_space()
|
57 |
+
try:
|
58 |
+
print(DYNAMIC_INFO_PATH)
|
59 |
+
snapshot_download(
|
60 |
+
repo_id=DYNAMIC_INFO_REPO, local_dir=DYNAMIC_INFO_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
|
61 |
+
)
|
62 |
+
except Exception:
|
63 |
+
restart_space()
|
64 |
+
try:
|
65 |
+
print(EVAL_RESULTS_PATH)
|
66 |
+
snapshot_download(
|
67 |
+
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
|
68 |
+
)
|
69 |
+
except Exception:
|
70 |
+
restart_space()
|
71 |
|
72 |
|
73 |
raw_data, original_df = get_leaderboard_df(
|
src/tools/plots.py
CHANGED
@@ -31,7 +31,9 @@ def create_scores_df(raw_data: list[EvalResult]) -> pd.DataFrame:
|
|
31 |
column = task.col_name
|
32 |
for _, row in results_df.iterrows():
|
33 |
current_model = row["full_model"]
|
34 |
-
|
|
|
|
|
35 |
continue
|
36 |
|
37 |
current_date = row["date"]
|
|
|
31 |
column = task.col_name
|
32 |
for _, row in results_df.iterrows():
|
33 |
current_model = row["full_model"]
|
34 |
+
# We ignore models that are flagged/no longer on the hub/not finished
|
35 |
+
to_ignore = not row["still_on_hub"] or row["flagged"] or current_model in FLAGGED_MODELS or row["status"] != "FINISHED"
|
36 |
+
if to_ignore:
|
37 |
continue
|
38 |
|
39 |
current_date = row["date"]
|