n1ck-guo commited on
Commit
a0567b7
1 Parent(s): b22a548

add hf token

Browse files

Signed-off-by: n1ck-guo <heng.guo@intel.com>

Files changed (2) hide show
  1. src/envs.py +1 -0
  2. src/submission/check_validity.py +3 -2
src/envs.py CHANGED
@@ -6,6 +6,7 @@ from huggingface_hub import HfApi
6
  H4_TOKEN = os.environ.get("H4_TOKEN", None)
7
  GIT_TOKEN = os.environ.get("GIT_TOKEN", None)
8
  GIT_REPO = os.environ.get("GIT_REPO", None)
 
9
 
10
  REPO_ID = "Intel/low-bit-leaderboard"
11
  QUEUE_REPO = "Intel/ld_requests"
 
6
  H4_TOKEN = os.environ.get("H4_TOKEN", None)
7
  GIT_TOKEN = os.environ.get("GIT_TOKEN", None)
8
  GIT_REPO = os.environ.get("GIT_REPO", None)
9
+ HF_TOKEN = os.environ.get("HF_TOKEN", None)
10
 
11
  REPO_ID = "Intel/low-bit-leaderboard"
12
  QUEUE_REPO = "Intel/ld_requests"
src/submission/check_validity.py CHANGED
@@ -5,17 +5,18 @@ from collections import defaultdict
5
  from datetime import datetime, timedelta, timezone
6
 
7
  import huggingface_hub
8
- from huggingface_hub import ModelCard
9
  from huggingface_hub.hf_api import ModelInfo, get_safetensors_metadata
10
  from transformers import AutoConfig, AutoTokenizer
11
 
12
- from src.envs import HAS_HIGHER_RATE_LIMIT
13
  from huggingface_hub import hf_hub_download, HfFileSystem
14
  from huggingface_hub.utils import validate_repo_id
15
  from pathlib import Path
16
  import fnmatch
17
  from huggingface_hub.hf_api import get_hf_file_metadata, hf_hub_url
18
 
 
19
 
20
  # ht to @Wauplin, thank you for the snippet!
21
  # See https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/317
 
5
  from datetime import datetime, timedelta, timezone
6
 
7
  import huggingface_hub
8
+ from huggingface_hub import ModelCard, login
9
  from huggingface_hub.hf_api import ModelInfo, get_safetensors_metadata
10
  from transformers import AutoConfig, AutoTokenizer
11
 
12
+ from src.envs import HAS_HIGHER_RATE_LIMIT, HF_TOKEN
13
  from huggingface_hub import hf_hub_download, HfFileSystem
14
  from huggingface_hub.utils import validate_repo_id
15
  from pathlib import Path
16
  import fnmatch
17
  from huggingface_hub.hf_api import get_hf_file_metadata, hf_hub_url
18
 
19
+ login(token=HF_TOKEN)
20
 
21
  # ht to @Wauplin, thank you for the snippet!
22
  # See https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/317