VITS2 Backbone with bert
!git clone https://github.com/Mr47121836/Bert-VITS2.git
%cd Bert-VITS2
!pip install -r requirements.txt
train_name = "xss"
!wget https://huggingface.co/datasets/guetLzy/genshin/resolve/main/%E7%94%B3%E9%B9%A4.zip -O ./wav/申鹤.zip
!wget https://huggingface.co/datasets/guetLzy/genshin/resolve/main/%E5%85%AB%E9%87%8D%E7%A5%9E%E5%AD%90.zip -O ./wav/八重神子.zip
!wget https://huggingface.co/datasets/guetLzy/genshin/resolve/main/%E9%A6%99%E8%8F%B1.zip -O ./wav/香菱.zip
!unzip -j ./wav/八重神子.zip "*.wav" -d ./wav/八重神子/
!unzip -j ./wav/申鹤.zip "*.wav" -d ./wav/申鹤/
!unzip -j ./wav/香菱.zip "*.wav" -d ./wav/香菱/
wav
├───神里绫华
├ ├───xxx.wav
├ ├───...
├ ├───yyy.wav
├ └───zzz.wav
├───刻晴
├ ├───xxx.wav
├ ├───...
├ ├───yyy.wav
├ └───zzz.wav
├───...
├
└───钟离
├───xxx.wav
├───...
├───yyy.wav
└───zzz.wav
import os
from tqdm import tqdm
# 每个说话人保留的语音条数
keep_num = 500
for dir_name in os.listdir("./wav"):
if dir_name.endswith("zip") or dir_name.endswith("md") :
os.remove(os.path.join("./wav",dir_name))
for dir_name in tqdm(os.listdir("./wav/")):
folder_path = './wav/' + dir_name
num = 1
for file in tqdm(os.listdir(folder_path)):
if(num <= keep_num):
s = '%06d' % num # 前面补零占位
os.rename(os.path.join(folder_path, file), os.path.join(folder_path, str(s) + '.wav'))
else:
os.remove(os.path.join(folder_path, file))
num += 1
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/medium.pt -O ./whisper_model/medium.pt
!python generate_filelist.py
!python preprocess_text.py
%cd monotonic_align/
!mkdir monotonic_align
!python setup.py build_ext --inplace
%cd ..
!mkdir -p ./logs/{train_name}
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/DUR_0.pth -O ./logs/{train_name}/DUR_0.pth
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/D_0.pth -O ./logs/{train_name}/D_0.pth
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/G_0.pth -O ./logs/{train_name}/G_0.pth
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/pytorch_model.bin -O ./bert/chinese-roberta-wwm-ext-large/pytorch_model.bin
!wget https://huggingface.co/guetLzy/Bert-Vits2-PreWeight/resolve/main/medium.pt -O ./whisper_model/medium.pt
!python bert_gen.py
!python train_ms.py -c configs/config.json -m {train_name}
推荐使用Colab
- anyvoiceai/MassTTS
- jaywalnut310/vits
- p0p4k/vits2_pytorch
- svc-develop-team/so-vits-svc
- PaddlePaddle/PaddleSpeech