下载 Hugging Face 中的模型文件
- 1. Hugging Face Hub
- 2. ggerganov/whisper.cpp
- 3. 点击图标下载文件
- 4. Clone this model repository
- 5. Using the Hugging Face Client Library
- 6. Using Git
- References
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:~$ mkdir whisper_work
(base) yongqiang@yongqiang:~$ cd whisper_work/
(base) yongqiang@yongqiang:~/whisper_work$ git lfs install
Error: Failed to call git rev-parse --git-dir: exit status 128
Git LFS initialized.
(base) yongqiang@yongqiang:~/whisper_work$
(base) yongqiang@yongqiang:~/whisper_work$ pwd
/home/yongqiang/whisper_work
(base) yongqiang@yongqiang:~/whisper_work$ git clone https://huggingface.co/ggerganov/whisper.cpp
...
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