Bert-vits2-2.3-Final,Bert-vits2最终版一键整合包(复刻生化危机艾达王)

简介: 近日,Bert-vits2发布了最新的版本2.3-final,意为最终版,修复了一些已知的bug,添加基于 WavLM 的 Discriminator(来源于 StyleTTS2),令人意外的是,因情感控制效果不佳,去除了 CLAP情感模型,换成了相对简单的 BERT 融合语义方式。

ada.jpg

近日,Bert-vits2发布了最新的版本2.3-final,意为最终版,修复了一些已知的bug,添加基于 WavLM 的 Discriminator(来源于 StyleTTS2),令人意外的是,因情感控制效果不佳,去除了 CLAP情感模型,换成了相对简单的 BERT 融合语义方式。

事实上,经过2.2版本的测试,CLAP情感模型的效果还是不错的,关于2.2版本,请移步:

Bert-vits2-v2.2新版本本地训练推理整合包(原神八重神子英文模型miko)

更多情报请关注Bert-vits2官网:

https://github.com/fishaudio/Bert-VITS2/releases/tag/v2.3

本次我们基于最新版Bert-vits2-2.3来复刻生化危机经典角色艾达王(ada wong)的声音。

Bert-vits2-2.3项目配置

首先克隆项目:

git clone https://github.com/v3ucn/Bert-vits2-V2.3.git

注意该项目fork自Bert-vits2的2.3分支,在其基础上增加了素材切分和转写标注等功能,更易于使用。

随后进入项目:

cd Bert-vits2-V2.3

安装依赖:

pip3 install -r requirements.txt

随后下载对应的模型,首先是bert模型:

https://openi.pcl.ac.cn/Stardust_minus/Bert-VITS2/modelmanage/show_model

放入到bert目录:

E:\work\Bert-VITS2-2.3\bert>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
│   bert_models.json  
│  
├───bert-base-japanese-v3  
│       .gitattributes  
│       config.json  
│       README.md  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───bert-large-japanese-v2  
│       .gitattributes  
│       config.json  
│       README.md  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───chinese-roberta-wwm-ext-large  
│       .gitattributes  
│       added_tokens.json  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───deberta-v2-large-japanese  
│       .gitattributes  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│  
├───deberta-v2-large-japanese-char-wwm  
│       .gitattributes  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer_config.json  
│       vocab.txt  
│  
└───deberta-v3-large  
        .gitattributes  
        config.json  
        generator_config.json  
        pytorch_model.bin  
        README.md  
        spm.model  
        tokenizer_config.json

注意,其中每个子目录中的pytorch_model.bin就是bert模型本体。

随后还得下载clap模型,虽然推理已经把clap去掉了,同时下载wav2vec2-large-robust-12-ft-emotion-msp-dim模型,放入到项目的emotional目录:

E:\work\Bert-VITS2-2.3\emotional>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
├───clap-htsat-fused  
│       .gitattributes  
│       config.json  
│       merges.txt  
│       preprocessor_config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│       vocab.json  
│  
└───wav2vec2-large-robust-12-ft-emotion-msp-dim  
        .gitattributes  
        config.json  
        LICENSE  
        preprocessor_config.json  
        pytorch_model.bin  
        README.md  
        vocab.json

最后下载底模:

https://huggingface.co/OedoSoldier/Bert-VITS2-2.3

放入到角色的models目录即可。

请注意这次2.3的底模是4个文件。

Bert-vits2-2.3数据预处理

把艾达王的语音素材放入到Data/ada/raw目录中,执行切分脚本:

python3 audio_slicer.py

会切分成小片素材:

E:\work\Bert-VITS2-2.3\Data\ada\raw>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
    ada_0.wav  
    ada_1.wav  
    ada_10.wav  
    ada_11.wav  
    ada_12.wav  
    ada_13.wav  
    ada_14.wav  
    ada_15.wav  
    ada_16.wav  
    ada_17.wav  
    ada_18.wav  
    ada_19.wav  
    ada_2.wav  
    ada_20.wav  
    ada_21.wav  
    ada_22.wav  
    ada_23.wav  
    ada_24.wav  
    ada_25.wav  
    ada_26.wav  
    ada_3.wav  
    ada_4.wav  
    ada_5.wav  
    ada_6.wav  
    ada_7.wav  
    ada_8.wav  
    ada_9.wav

随后运行转写和标注:

python3 short_audio_transcribe.py

程序返回:

E:\work\Bert-VITS2-2.3\venv\lib\site-packages\whisper\timing.py:58: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.  
  def backtrace(trace: np.ndarray):  
Data/ada/raw  
Detected language: en  
I do. The kind you like.  
Processed: 1/27  
Detected language: en  
Now where's the amber?  
Processed: 2/27  
Detected language: en  
Leave the girl. She's lost no matter what.  
Processed: 3/27  
Detected language: en  
You walk away now, and who knows?  
Processed: 4/27  
Detected language: en  
Maybe you'll live to meet me again.  
Processed: 5/27  
Detected language: en  
And I might get you that greeting you were looking for.  
Processed: 6/27  
Detected language: en  
How about we continue this discussion another time?  
Processed: 7/27  
Detected language: en  
Sorry, nothing yet.  
Processed: 8/27  
Detected language: en  
But my little helper is creating  
Processed: 9/27  
Detected language: en  
Quite the commotion.  
Processed: 10/27  
Detected language: en  
Everything will work out just fine.  
Processed: 11/27  
Detected language: en  
He's a good boy. Predictable.  
Processed: 12/27  
Detected language: en  
The deal was, we get you out of here when you deliver the amber. No amber, no protection, Louise.  
Processed: 13/27  
Detected language: en  
Nothing personal, Leon.  
Processed: 14/27  
Detected language: en  
Louise and I had an arrangement.  
Processed: 15/27  
Detected language: en  
Don't worry, I'll take good care of it.  
Processed: 16/27  
Detected language: en  
Just one question.  
Processed: 17/27  
Detected language: en  
What are you planning to do with this?  
Processed: 18/27  
Detected language: en  
So, we're talking millions of casualties?  
Processed: 19/27  
Detected language: en  
We're changing course. Now.  
Processed: 20/27  
Detected language: en  
You can stop right there, Leon.  
Processed: 21/27  
Detected language: en  
wouldn't make me use this.  
Processed: 22/27  
Detected language: en  
Would you? You don't seem surprised.  
Processed: 23/27  
Detected language: en  
Interesting.  
Processed: 24/27  
Detected language: en  
Not a bad move  
Processed: 25/27  
Detected language: en  
Very smooth. Ah, Leon.  
Processed: 26/27  
Detected language: en  
You know I don't work and tell.

注意,这里whiper会报一个警告,如果觉得不好看,可以修改timing.py第58行:

修改前  
@numba.jit  
def backtrace(trace: np.ndarray):  

修改后  
@numba.jit(nopython=True)  
def backtrace(trace: np.ndarray):

随后,运行web预处理界面:

python3 webui_preprocess.py

随后按照页面提示操作即可:

至此,数据预处理就结束了。

Bert-vits2-2.3训练和推理

在根目录运行命令:

python3 train_ms.py

模型会在models目录生成:

E:\work\Bert-VITS2-2.3\Data\ada\models>tree/f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
    G_150.pth

随后开启推理页面进行推理即可:

python3 webui.py

新的推理页面增加了使用辅助文本的语意来辅助生成对话(语言保持与主文本相同),即以提示词prompt的形式来定制化生成语音的风格。

但又不能使用使用指令式文本(如:开心),要使用带有强烈情感的文本(如:我好快乐!!!)

这就导致生成的语音情感风格比较玄学:

因为你得不停地调整prompt来测试效果,不如之前地clap情感的audio prompt来的直观,但客观上讲,通过bert语义文本引导的风格化情感语音还是有一定效果的。

结语

更新Bert-vits2系列基础教程的同时,也学习到了很多东西,毫无疑问,Bert-vits2让更多的人领略到了深度学习的魅力,它是一个极其优秀的人工智能入门项目,兴趣永远是最好的老师,与各位共勉,最后奉上Bert-vits2-2.3-Final整合包:

整合包链接:https://pan.baidu.com/s/182LZCu5cyR3nH8EoTBLR-g?pwd=v3uc

与众乡亲同飨。

相关文章
|
7月前
|
机器学习/深度学习 缓存 自然语言处理
义无反顾马督工,Bert-vits2V210复刻马督工实践(Python3.10)
Bert-vits2更新了版本V210,修正了日/英的bert对齐问题,效果进一步优化;对底模使用的数据进行优化和加量,减少finetune失败以及电音的可能性;日语bert更换了模型,完善了多语言推理。
义无反顾马督工,Bert-vits2V210复刻马督工实践(Python3.10)
|
2月前
|
JavaScript
Bert-vits2-v2.2新版本本地训练推理整合包(原神八重神子英文模型miko)
近日,Bert-vits2-v2.2如约更新,该新版本v2.2主要把Emotion 模型换用CLAP多模态模型,推理支持输入text prompt提示词和audio prompt提示语音来进行引导风格化合成,让推理音色更具情感特色,并且推出了新的预处理webuI,操作上更加亲民和接地气。
Bert-vits2-v2.2新版本本地训练推理整合包(原神八重神子英文模型miko)
|
8月前
|
并行计算 API C++
又欲又撩人,基于新版Bert-vits2V2.0.2音色模型雷电将军八重神子一键推理整合包分享
Bert-vits2项目近期炸裂更新,放出了v2.0.2版本的代码,修正了存在于2.0先前版本的重大bug,并且重炼了底模,本次更新是即1.1.1版本后最重大的更新,支持了三语言训练及混合合成,并且做到向下兼容,可以推理老版本的模型,本次我们基于新版V2.0.2来本地推理原神小姐姐们的音色模型。
又欲又撩人,基于新版Bert-vits2V2.0.2音色模型雷电将军八重神子一键推理整合包分享
|
2月前
|
人工智能 自然语言处理 数据处理
首次引入大模型!Bert-vits2-Extra中文特化版40秒素材复刻巫师3叶奈法
Bert-vits2项目又更新了,更新了一个新的分支:中文特化,所谓中文特化,即针对中文音色的特殊优化版本,纯中文底模效果百尺竿头更进一步,同时首次引入了大模型,使用国产IDEA-CCNL/Erlangshen-MegatronBert-1.3B大模型作为Bert特征提取,基本上完全解决了发音的bad case,同时在情感表达方面有大幅提升,可以作为先前V1.0.1纯中文版本更好的替代。
首次引入大模型!Bert-vits2-Extra中文特化版40秒素材复刻巫师3叶奈法
|
2月前
|
自然语言处理 Python
【相关问题解答1】bert中文文本摘要代码:import时无法找到包时,几个潜在的原因和解决方法
【相关问题解答1】bert中文文本摘要代码:import时无法找到包时,几个潜在的原因和解决方法
26 0
|
2月前
|
机器学习/深度学习 人工智能 开发工具
如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face
Hugging Face是一个机器学习(ML)和数据科学平台和社区,帮助用户构建、部署和训练机器学习模型。它提供基础设施,用于在实时应用中演示、运行和部署人工智能(AI)。用户还可以浏览其他用户上传的模型和数据集。Hugging Face通常被称为机器学习界的GitHub,因为它让开发人员公开分享和测试他们所训练的模型。 本次分享如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face。
如何快速部署本地训练的 Bert-VITS2 语音模型到 Hugging Face
|
2月前
|
PyTorch 算法框架/工具
Bert Pytorch 源码分析:五、模型架构简图 REV1
Bert Pytorch 源码分析:五、模型架构简图 REV1
43 0
|
2月前
|
PyTorch 算法框架/工具
Bert Pytorch 源码分析:五、模型架构简图
Bert Pytorch 源码分析:五、模型架构简图
42 0
|
8月前
lda模型和bert模型的文本主题情感分类实战
lda模型和bert模型的文本主题情感分类实战
151 0
|
6天前
|
机器学习/深度学习 自然语言处理 TensorFlow
使用Python实现深度学习模型:BERT模型教程
使用Python实现深度学习模型:BERT模型教程
51 0

热门文章

最新文章