pminervini commited on
Commit
0f6a779
1 Parent(s): 5a0f81d
Files changed (1) hide show
  1. src/backend/manage_requests.py +4 -4
src/backend/manage_requests.py CHANGED
@@ -5,6 +5,8 @@ from typing import Optional
5
 
6
  from huggingface_hub import HfApi, snapshot_download
7
 
 
 
8
 
9
  @dataclass
10
  class EvalRequest:
@@ -67,7 +69,7 @@ def get_eval_requests(job_status: list, local_dir: str, hf_repo: str) -> list[Ev
67
  Returns:
68
  `list[EvalRequest]`: a list of model info dicts.
69
  """
70
- snapshot_download(repo_id=hf_repo, revision="main", local_dir=local_dir, repo_type="dataset", max_workers=60)
71
  json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
72
 
73
  eval_requests = []
@@ -91,11 +93,9 @@ def get_eval_requests(job_status: list, local_dir: str, hf_repo: str) -> list[Ev
91
  def check_completed_evals(api: HfApi, hf_repo: str, local_dir: str, checked_status: str, completed_status: str,
92
  failed_status: str, hf_repo_results: str, local_dir_results: str):
93
  """Checks if the currently running evals are completed, if yes, update their status on the hub."""
94
-
95
- from src.utils import my_snapshot_download
96
  my_snapshot_download(repo_id=hf_repo_results, revision="main", local_dir=local_dir_results, repo_type="dataset", max_workers=60)
97
 
98
- running_evals = get_eval_requests(checked_status, hf_repo=hf_repo, local_dir=local_dir)
99
 
100
  for eval_request in running_evals:
101
  model = eval_request.model
 
5
 
6
  from huggingface_hub import HfApi, snapshot_download
7
 
8
+ from src.utils import my_snapshot_download
9
+
10
 
11
  @dataclass
12
  class EvalRequest:
 
69
  Returns:
70
  `list[EvalRequest]`: a list of model info dicts.
71
  """
72
+ my_snapshot_download(repo_id=hf_repo, revision="main", local_dir=local_dir, repo_type="dataset", max_workers=60)
73
  json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
74
 
75
  eval_requests = []
 
93
  def check_completed_evals(api: HfApi, hf_repo: str, local_dir: str, checked_status: str, completed_status: str,
94
  failed_status: str, hf_repo_results: str, local_dir_results: str):
95
  """Checks if the currently running evals are completed, if yes, update their status on the hub."""
 
 
96
  my_snapshot_download(repo_id=hf_repo_results, revision="main", local_dir=local_dir_results, repo_type="dataset", max_workers=60)
97
 
98
+ running_evals = get_eval_requests([checked_status], hf_repo=hf_repo, local_dir=local_dir)
99
 
100
  for eval_request in running_evals:
101
  model = eval_request.model