hf_down.py 499 Bytes
Newer Older
lipengfei's avatar
lipengfei committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# pip install huggingface-cli
import os

os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'

model_list = [
    "openai-community/gpt2",
    "stabilityai/stable-diffusion-2-1",
    "google-bert/bert-base-uncased"
]

os.system("pip install -U huggingface-hub")

for model_path in model_list:
    root_dir = os.path.basename(model_path)
    os.system(
        f"huggingface-cli download --resume-download  {model_path} --local-dir ./{root_dir}/{model_path} \
        --local-dir-use-symlinks False")