From 09f28ae518c38d1c010040e261ed561e420d0684 Mon Sep 17 00:00:00 2001 From: Zone Tome <1018995004@qq.com> Date: Wed, 30 Oct 2024 09:06:02 +0000 Subject: [PATCH] fix: docker add v2 models --- Docker/download.py | 41 +++++++++++++++++++++++++++++++++++++++++ Docker/links.txt | 6 ++++++ 2 files changed, 47 insertions(+) diff --git a/Docker/download.py b/Docker/download.py index 234fd06..ce397ec 100644 --- a/Docker/download.py +++ b/Docker/download.py @@ -3,3 +3,44 @@ from modelscope import snapshot_download model_dir = snapshot_download('damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch',revision="v2.0.4") model_dir = snapshot_download('damo/speech_fsmn_vad_zh-cn-16k-common-pytorch',revision="v2.0.4") model_dir = snapshot_download('damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',revision="v2.0.4") + +import nltk +nltk.download('averaged_perceptron_tagger_eng') + +# Download https://paddlespeech.bj.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip unzip and rename to G2PWModel, and then place them in GPT_SoVITS/text. + +import os +import zipfile +import shutil +import requests + +# 获取当前文件的路径 +current_file_path = os.path.abspath(__file__) +current_dir = os.path.dirname(current_file_path) + +# 定义下载链接和目标路径 +url = 'https://paddlespeech.bj.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip' +download_path = os.path.join(current_dir, 'G2PWModel_1.1.zip') +target_dir = os.path.join(current_dir, '../GPT_SoVITS/text/') + +# 下载文件 +response = requests.get(url) +with open(download_path, 'wb') as file: + file.write(response.content) + +# 解压文件 +with zipfile.ZipFile(download_path, 'r') as zip_ref: + zip_ref.extractall(current_dir) + +# 重命名解压后的文件夹 +os.rename(os.path.join(current_dir, 'G2PWModel_1.1'), os.path.join(current_dir, 'G2PWModel')) + +# 移动文件夹到目标目录 +if not os.path.exists(target_dir): + os.makedirs(target_dir) +shutil.move(os.path.join(current_dir, 'G2PWModel'), target_dir) + +# 清理临时文件 +os.remove(download_path) + +print("Download G2PWModel successfully") \ No newline at end of file diff --git a/Docker/links.txt b/Docker/links.txt index e6603db..147ea64 100644 --- a/Docker/links.txt +++ b/Docker/links.txt @@ -17,6 +17,12 @@ https://huggingface.co/lj1995/GPT-SoVITS/resolve/main/chinese-roberta-wwm-ext-la out=GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large/pytorch_model.bin https://huggingface.co/lj1995/GPT-SoVITS/resolve/main/chinese-roberta-wwm-ext-large/tokenizer.json out=GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large/tokenizer.json +https://huggingface.co/lj1995/GPT-SoVITS/resolve/main/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt + out=GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt +https://huggingface.co/lj1995/GPT-SoVITS/resolve/main/gsv-v2final-pretrained/s2D2333k.pth + out=GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2D2333k.pth +https://huggingface.co/lj1995/GPT-SoVITS/resolve/main/gsv-v2final-pretrained/s2G2333k.pth + out=GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth # UVR5 https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2_all_vocals.pth out=tools/uvr5/uvr5_weights/HP2_all_vocals.pth