Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker构建下载脚本支持V2模型 #1732

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Docker/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,44 @@
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")
6 changes: 6 additions & 0 deletions Docker/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down