服务器连接hugging face失败


1. 启用hf镜像

export HF_ENDPOINT=``https://hf-mirror.com

2. 为了防止重启终端后失效,建议将上述命令写入配置文件并执行 source

  • source ~/.zshrc (如果你使用的是 Zsh)
  • source ~/.bashrc (如果你使用的是 Bash)

3. 检查是否启用成功

运行以下命令验证环境变量:
echo $HF_ENDPOINT
返回下面的说明成功了:
启用成功

4. 获取模型克隆命令

打开 Hugging Face 的模型页面,点击 Clone repository 获取地址:
hugging face model

5. 安装工具并下载

首先安装官方命令行工具 huggingface_hub,然后使用 hf download 即可高速下载:
pip install -U "huggingface_hub"
hf download


Author: 地狱天使
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source 地狱天使 !
  TOC