日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face

發(fā)布時(shí)間:2024/1/16 windows 39 coder
生活随笔 收集整理的這篇文章主要介紹了 如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Hugging Face是一個(gè)機(jī)器學(xué)習(xí)(ML)和數(shù)據(jù)科學(xué)平臺和社區(qū),幫助用戶構(gòu)建、部署和訓(xùn)練機(jī)器學(xué)習(xí)模型。它提供基礎(chǔ)設(shè)施,用于在實(shí)時(shí)應(yīng)用中演示、運(yùn)行和部署人工智能(AI)。用戶還可以瀏覽其他用戶上傳的模型和數(shù)據(jù)集。Hugging Face通常被稱為機(jī)器學(xué)習(xí)界的GitHub,因?yàn)樗岄_發(fā)人員公開分享和測試他們所訓(xùn)練的模型。

本次分享如何快速部署本地訓(xùn)練的 Bert-VITS2 語音模型到 Hugging Face。

本地配置HuggingFace

首先注冊HuggingFace平臺:

https://huggingface.co/join

隨后在用戶的設(shè)置界面新建token,也就是令牌:

這里令牌有兩種權(quán)限類型,一種是寫權(quán)限,另外一種是讀權(quán)限。

隨后本地安裝Huggingface客戶端:

pip install huggingface_hub

隨后運(yùn)行命令登錄Huggingface賬號:

huggingface-cli login

此時(shí)需要用到剛剛創(chuàng)建的token,復(fù)制寫token,粘貼到命令行中:

E:\work>huggingface-cli login  
  
    _|    _|  _|    _|    _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|_|_|_|    _|_|      _|_|_|  _|_|_|_|  
    _|    _|  _|    _|  _|        _|          _|    _|_|    _|  _|            _|        _|    _|  _|        _|  
    _|_|_|_|  _|    _|  _|  _|_|  _|  _|_|    _|    _|  _|  _|  _|  _|_|      _|_|_|    _|_|_|_|  _|        _|_|_|  
    _|    _|  _|    _|  _|    _|  _|    _|    _|    _|    _|_|  _|    _|      _|        _|    _|  _|        _|  
    _|    _|    _|_|      _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|        _|    _|    _|_|_|  _|_|_|_|  
  
    A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.  
    Setting a new token will erase the existing one.  
    To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .  
Token can be pasted using 'Right-Click'.  
Token:  
Add token as git credential? (Y/n) y  
Token is valid (permission: write).  
Cannot authenticate through git-credential as no helper is defined on your machine.  
You might have to re-authenticate when pushing to the Hugging Face Hub.  
Run the following command in your terminal in case you want to set the 'store' credential helper as default.  
  
git config --global credential.helper store  
  
Read https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage for more details.  
Token has not been saved to git credential helper.  
Your token has been saved to C:\Users\zcxey\.cache\huggingface\token  
Login successful

顯示Login successful即代表登錄成功。

隨后,可以使用命令來創(chuàng)建模型的repo項(xiàng)目:

huggingface-cli repo create wizard3

這里創(chuàng)建巫師3系列角色模型。

程序返回:

E:\work>huggingface-cli repo create wizard3  
git version 2.31.0.windows.1  
git-lfs/2.13.2 (GitHub; windows amd64; go 1.14.13; git fc664697)  
  
You are about to create v3ucn/wizard3  
Proceed? [Y/n] y  
  
Your repo now lives at:  
  https://huggingface.co/v3ucn/wizard3  
  
You can clone it locally with the command below, and commit/push as usual.  
  
  git clone https://huggingface.co/v3ucn/wizard3

說明已經(jīng)創(chuàng)建好模型項(xiàng)目了。

當(dāng)然,過程中可能會報(bào)443的錯(cuò)誤,如果您身在國內(nèi),這是十分合理的現(xiàn)象。

此時(shí),可以通過給git配置代理來解決:

配置socks5  
  
git config --global http.proxy socks5 127.0.0.1:7890  
git config --global https.proxy socks5 127.0.0.1:7890  
  
配置http  
  
git config --global http.proxy 127.0.0.1:7890  
git config --global https.proxy 127.0.0.1:7890

其中7890為您在國內(nèi)學(xué)術(shù)上網(wǎng)用的端口號,啥叫學(xué)術(shù)上網(wǎng)?很抱歉這里無法多做解釋。

同時(shí)也可以通過命令取消git學(xué)術(shù)上網(wǎng):

git config --global --unset http.proxy  
git config --global --unset https.proxy

接著本地克隆項(xiàng)目:

git clone https://huggingface.co/v3ucn/wizard3

隨后將模型本體和配置文件config.json放入wizard3目錄。

提交后,推送即可:

E:\work>cd wizard3  
  
E:\work\wizard3>git add -A  
  
E:\work\wizard3>git commit -m "commit from liuyue "  
[main cd327b9] commit from liuyue  
 2 files changed, 114 insertions(+)  
 create mode 100644 G_200.pth  
 create mode 100644 config.json  
  
E:\work\wizard3>git push  
Uploading LFS objects:   0% (0/1), 925 MB | 2.4 MB/s

此時(shí),git就會把模型推送到Huggingface云端。

推送完畢后,訪問線上地址,即可查看模型:

https://huggingface.co/v3ucn/wizard3/tree/main

結(jié)語

Hugging Face的優(yōu)勢包括可訪問性、集成性、快速原型設(shè)計(jì)和部署、社區(qū)和成本效益,是不可多得的機(jī)器學(xué)習(xí)交流平臺。

總結(jié)

以上是生活随笔為你收集整理的如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。