"vscode:/vscode.git/clone" did not exist on "9f6e97865cb31588fd81dc50bf82043e0b09e343"
hf_down.py 518 Bytes
Newer Older
chenpangpang's avatar
chenpangpang committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# pip install huggingface-cli
import os

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

model_list = [
    "openai-community/gpt2",
    # "stabilityai/stable-diffusion-xl-base-1.0"
]

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 --token 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")