1、安装 huggingface-cli
pip install -U huggingface_hub
2、设置环境变量(如果你打算使用 HF_ENDPOINT
环境变量来指定下载镜像站点):
export HF_ENDPOINT=https://hf-mirror.com
3、使用 huggingface-cli 下载模型:
使用下面的命令来下载模型,其中 --resume-download
允许从中断的地方继续下载,--local-dir
指定了下载文件存放的本地目录。
huggingface-cli download --resume-download --local-dir Use-Your-Desired-Directory codellama/CodeLlama-7b-Instruct-hf