huggingface的镜像站hf-mirror.com使用方法
通过镜像站hf-mirror.com自动下载model
1、设置环境变量
# windows dos
set HF_ENDPOINT=https://hf-mirror.com
# linux bash
export HF_ENDPOINT=https://hf-mirror.com
# linux csh
setenv HF_ENDPOINT https://hf-mirror.com
2、下载模型
与huggingface-cli兼容,直接下载。
# 断点续传,如果local dir不存在会自动创建
huggingface-cli download --resume-download gpt2 --local-dir gpt2