Huggingface 的国内镜像

收集各个python和pytorch 的source 镜像.
huggingface 最全的model 和dataset 的开源网站

huggingface-cli 是 Hugging Face 官方提供的命令行工具,自带完善的下载功能。

1. 安装依赖

pip install -U huggingface_hub

2. 设置环境变量

Linux

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

Windows Powershell

$env:HF_ENDPOINT = "https://hf-mirror.com"

建议将上面这一行写入~/.bashrc

3.1 下载模型

huggingface-cli download --resume-download gpt2 --local-dir gpt2

3.2 下载数据集

huggingface-cli download --repo-type dataset --resume-download wikitext --local-dir wikitext

可以添加--local-dir-use-symlinks False参数禁用文件软链接,这样下载路径下所见即所得,详细解释请见上面提到的教程

posted @ 2026-04-10 15:43  CharyGao  阅读(487)  评论(0)    收藏  举报