huggingface_hub cli 使用以及国内加速配置

主要是一个简单记录,方便后续使用

安装

pip install -U huggingface_hub

使用

  • 下载模型
huggingface-cli download --resume-download gpt2 --local-dir gpt2
  • 下载数据
huggingface-cli download --repo-type dataset --resume-download wikitext --local-dir wikitext
  • 默认cache 位置
$HOME/.cache/huggingface/hub

加速

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

参考资料

https://hf-mirror.com/

posted on 2024-08-18 06:19  荣锋亮  阅读(7)  评论(0编辑  收藏  举报

导航