From f5ae4801dd198386bd8336dc650d721032c3d541 Mon Sep 17 00:00:00 2001 From: XXXXRT666 Date: Fri, 2 Aug 2024 18:27:08 +0800 Subject: [PATCH] chores chores chores chores chores remove useless commit chores chores chores chores remove useless commit chores chores chores chores remove useless commit --- .gitignore | 2 +- GPT_SoVITS/inference_webui.py | 12 +++++++----- webui.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 3899ba08..f476f95f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ GPT_weights SoVITS_weights TEMP gweight.txt -sweight.txt \ No newline at end of file +sweight.txt diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index 131c6f68..96cd398f 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -20,6 +20,9 @@ import torch version=os.environ.get("version","v1") language=os.environ.get("language","auto") +version="v2"if sys.argv[1]=="v2" else version +os.environ['version']=version +language=sys.argv[-1] if sys.argv[-1]!='v2' and sys.argv[-1]!='v1' else language pretrained_sovits_name="GPT_SoVITS/pretrained_models/s2G488k.pth"if version=="v1"else"GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth" pretrained_gpt_name="GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt"if version=="v1"else "GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt" @@ -28,16 +31,15 @@ if os.path.exists("./gweight.txt"): gweight_data = file.read() gpt_path = os.environ.get( "gpt_path", gweight_data) -else: - gpt_path = os.environ.get( - "gpt_path", pretrained_gpt_name) +if version == 'v2': + gpt_path = os.environ.get("gpt_path", pretrained_gpt_name) if os.path.exists("./sweight.txt"): with open("./sweight.txt", 'r', encoding="utf-8") as file: sweight_data = file.read() sovits_path = os.environ.get("sovits_path", sweight_data) -else: - sovits_path = os.environ.get("sovits_path", pretrained_sovits_name) +if version == 'v2': + sovits_path = os.environ.get("sovits_path", pretrained_sovits_name) # gpt_path = os.environ.get( # "gpt_path", pretrained_gpt_name # ) diff --git a/webui.py b/webui.py index e962bec4..9c408d4f 100644 --- a/webui.py +++ b/webui.py @@ -1,5 +1,5 @@ import os,shutil,sys,pdb,re -version="v2"if sys.argv[0]=="v2" else"v1" +version="v2"if sys.argv[1]=="v2" else"v1" language=sys.argv[-1] if sys.argv[-1]!='v2' and sys.argv[-1]!='v1' else 'auto' os.environ["version"]=version os.environ["language"]=language @@ -208,7 +208,7 @@ def change_tts_inference(if_tts,bert_path,cnhubert_base_path,gpu_number,gpt_path os.environ["is_half"]=str(is_half) os.environ["infer_ttswebui"]=str(webui_port_infer_tts) os.environ["is_share"]=str(is_share) - cmd = '"%s" GPT_SoVITS/inference_webui.py'%(python_exec) + cmd = '"%s" GPT_SoVITS/inference_webui.py "%s"'%(python_exec, language) yield i18n("TTS推理进程已开启") print(cmd) p_tts_inference = Popen(cmd, shell=True)