当前位置:   article > 正文

下载 Hugging Face 中的模型文件_hugging face 下载模型

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
(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$
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

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)
)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

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
  • 1
  • 2

在这里插入图片描述

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/943062
推荐阅读
相关标签
  

闽ICP备14008679号