meg-huggingface commited on
Commit
2b38d40
1 Parent(s): 5f3db90

Adding TOKEN when calling snapshot_download, to handle private directories.

Browse files
scripts/create_request_file.py CHANGED
@@ -7,6 +7,7 @@ from datetime import datetime, timezone
7
  import click
8
  from colorama import Fore
9
  from huggingface_hub import HfApi, snapshot_download
 
10
 
11
  EVAL_REQUESTS_PATH = "eval-queue"
12
  QUEUE_REPO = "open-llm-leaderboard/requests"
@@ -36,7 +37,7 @@ def get_model_size(model_info, precision: str):
36
  def main():
37
  api = HfApi()
38
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
39
- snapshot_download(repo_id=QUEUE_REPO, revision="main", local_dir=EVAL_REQUESTS_PATH, repo_type="dataset")
40
 
41
  model_name = click.prompt("Enter model name")
42
  revision = click.prompt("Enter revision", default="main")
 
7
  import click
8
  from colorama import Fore
9
  from huggingface_hub import HfApi, snapshot_download
10
+ from src.envs import TOKEN
11
 
12
  EVAL_REQUESTS_PATH = "eval-queue"
13
  QUEUE_REPO = "open-llm-leaderboard/requests"
 
37
  def main():
38
  api = HfApi()
39
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
40
+ snapshot_download(repo_id=QUEUE_REPO, revision="main", token=TOKEN, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset")
41
 
42
  model_name = click.prompt("Enter model name")
43
  revision = click.prompt("Enter revision", default="main")
src/backend/manage_requests.py CHANGED
@@ -71,7 +71,7 @@ def get_eval_requests(job_status: list, local_dir: str, hf_repo: str) -> list[Ev
71
  Returns:
72
  `list[EvalRequest]`: a list of model info dicts.
73
  """
74
- snapshot_download(repo_id=hf_repo, revision="main", local_dir=local_dir, repo_type="dataset", max_workers=60)
75
  json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
76
 
77
  eval_requests = []
@@ -97,7 +97,7 @@ def check_completed_evals(
97
  local_dir_results: str,
98
  ):
99
  """Checks if the currently running evals are completed, if yes, update their status on the hub."""
100
- snapshot_download(repo_id=hf_repo_results, revision="main", local_dir=local_dir_results, repo_type="dataset", max_workers=60)
101
 
102
  running_evals = get_eval_requests(checked_status, hf_repo=hf_repo, local_dir=local_dir)
103
 
 
71
  Returns:
72
  `list[EvalRequest]`: a list of model info dicts.
73
  """
74
+ snapshot_download(repo_id=hf_repo, revision="main", token=TOKEN, local_dir=local_dir, repo_type="dataset", max_workers=60)
75
  json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
76
 
77
  eval_requests = []
 
97
  local_dir_results: str,
98
  ):
99
  """Checks if the currently running evals are completed, if yes, update their status on the hub."""
100
+ snapshot_download(repo_id=hf_repo_results, revision="main", token=TOKEN, local_dir=local_dir_results, repo_type="dataset", max_workers=60)
101
 
102
  running_evals = get_eval_requests(checked_status, hf_repo=hf_repo, local_dir=local_dir)
103