Clémentine commited on
Commit
dbb8b5d
1 Parent(s): 8cc38c3

update plot to only look at correct models

Browse files
Files changed (2) hide show
  1. app.py +23 -22
  2. 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
- try:
50
- print(EVAL_REQUESTS_PATH)
51
- snapshot_download(
52
- repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
53
- )
54
- except Exception:
55
- restart_space()
56
- try:
57
- print(DYNAMIC_INFO_PATH)
58
- snapshot_download(
59
- repo_id=DYNAMIC_INFO_REPO, local_dir=DYNAMIC_INFO_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
60
- )
61
- except Exception:
62
- restart_space()
63
- try:
64
- print(EVAL_RESULTS_PATH)
65
- snapshot_download(
66
- repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30
67
- )
68
- except Exception:
69
- restart_space()
 
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
- if current_model in FLAGGED_MODELS:
 
 
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"]