huggingface的镜像站hf-mirror.com使用方法
专栏:web开发笔记 Feb. 26, 2026, 10:46 a.m. 17 阅读
通过镜像站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
感谢阅读,更多文章点击这里:【专栏:web开发笔记】
最新20篇 开设专栏