下载 Hugging Face 中的模型文件

1. Hugging Face Hub

The Hugging Face Hub is a platform with over 350k models, 75k datasets, and 150k demo apps (Spaces), all open source and publicly available, in an online platform where people can easily collaborate and build ML together. The Hub works as a central place where anyone can explore, experiment, collaborate, and build technology with Machine Learning.

Downloading models

https://huggingface.co/docs/hub/models-downloading

2. ggerganov/whisper.cpp

https://huggingface.co/ggerganov/whisper.cpp/tree/main

在这里插入图片描述

在这里插入图片描述

3. 点击图标下载文件

在这里插入图片描述

4. Clone this model repository

在这里插入图片描述

在这里插入图片描述

# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install

git clone https://huggingface.co/ggerganov/whisper.cpp

# If you want to clone without large files - just their pointers
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/ggerganov/whisper.cpp
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$ git lfs install
Error: Failed to call git rev-parse --git-dir: exit status 128
Git LFS initialized.
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$ git lfs install --skip-repo
Git LFS initialized.
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$ GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/ggerganov/whisper.cpp
Cloning into 'whisper.cpp'...
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (39/39), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 56 (delta 6), reused 0 (delta 0), pack-reused 17 (from 1)
Unpacking objects: 100% (56/56), 11.31 KiB | 964.00 KiB/s, done.
(base) yongqiang@yongqiang:~/whisper_work/whisper_cpp_models$

5. Using the Hugging Face Client Library

You can use the huggingface_hub library to create, delete, update and retrieve information from repos. You can also download files from repos or integrate them into your library! For example, you can quickly load a Scikit-learn model with a few lines.

from huggingface_hub import hf_hub_download
import joblib

REPO_ID = "YOUR_REPO_ID"
FILENAME = "sklearn_model.joblib"

model = joblib.load(
    hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
)

6. Using Git

Since all models on the Model Hub are Git repositories, you can clone the models locally by running:

git lfs install
git clone git@hf.co:<MODEL ID> # example: git clone git@hf.co:bigscience/bloom

在这里插入图片描述

git lfs install
git clone https://huggingface.co/ggerganov/whisper.cpp

If you have write-access to the particular model repo, you’ll also have the ability to commit and push revisions to the model.

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
[2] Downloading models, https://huggingface.co/docs/hub/models-downloading
[3] Git Large File Storage (LFS) 的安装与使用, https://yongqiang.blog.csdn.net/article/details/139218502
[4] 配置 HTTP 代理 (HTTP proxy), https://yongqiang.blog.csdn.net/article/details/139378962

  • 13
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yongqiang Cheng

梦想不是浮躁,而是沉淀和积累。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值