File size: 700 Bytes
fc30f26
 
13a5c22
fc30f26
 
493a5f1
 
 
fc30f26
 
 
 
8679a35
 
 
 
 
 
 
 
 
 
fc30f26
 
 
 
 
13a5c22
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
from huggingface_hub import snapshot_download
from transformers.utils.hub import move_cache

hf_token: str = os.getenv("HF_TOKEN")
if hf_token is None:
    raise ValueError("HF_TOKEN is not set")

hf_token = hf_token.strip()
if hf_token == "":
    raise ValueError("HF_TOKEN is empty")


# This is about 2.47 GB
snapshot_download(
    repo_id="meta-llama/Llama-3.2-1B-Instruct",
    revision="9213176726f574b556790deb65791e0c5aa438b6",
    token=hf_token,
)


# This is about 3.67 GB
snapshot_download(
    repo_id="sail/Sailor-4B-Chat",
    revision="89a866a7041e6ec023dd462adeca8e28dd53c83e",
    token=hf_token,
)

# https://github.com/huggingface/transformers/issues/20428
move_cache()