chores

chores

chores

chores

remove useless commit

chores

chores

chores

chores

remove useless commit

chores

chores

chores

chores

remove useless commit
This commit is contained in:
XXXXRT666 2024-08-02 18:27:08 +08:00
parent b14f930220
commit f5ae4801dd
3 changed files with 10 additions and 8 deletions

View File

@ -20,6 +20,9 @@ import torch
version=os.environ.get("version","v1") version=os.environ.get("version","v1")
language=os.environ.get("language","auto") 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_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" 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,15 +31,14 @@ if os.path.exists("./gweight.txt"):
gweight_data = file.read() gweight_data = file.read()
gpt_path = os.environ.get( gpt_path = os.environ.get(
"gpt_path", gweight_data) "gpt_path", gweight_data)
else: if version == 'v2':
gpt_path = os.environ.get( gpt_path = os.environ.get("gpt_path", pretrained_gpt_name)
"gpt_path", pretrained_gpt_name)
if os.path.exists("./sweight.txt"): if os.path.exists("./sweight.txt"):
with open("./sweight.txt", 'r', encoding="utf-8") as file: with open("./sweight.txt", 'r', encoding="utf-8") as file:
sweight_data = file.read() sweight_data = file.read()
sovits_path = os.environ.get("sovits_path", sweight_data) sovits_path = os.environ.get("sovits_path", sweight_data)
else: if version == 'v2':
sovits_path = os.environ.get("sovits_path", pretrained_sovits_name) sovits_path = os.environ.get("sovits_path", pretrained_sovits_name)
# gpt_path = os.environ.get( # gpt_path = os.environ.get(
# "gpt_path", pretrained_gpt_name # "gpt_path", pretrained_gpt_name

View File

@ -1,5 +1,5 @@
import os,shutil,sys,pdb,re 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' language=sys.argv[-1] if sys.argv[-1]!='v2' and sys.argv[-1]!='v1' else 'auto'
os.environ["version"]=version os.environ["version"]=version
os.environ["language"]=language 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["is_half"]=str(is_half)
os.environ["infer_ttswebui"]=str(webui_port_infer_tts) os.environ["infer_ttswebui"]=str(webui_port_infer_tts)
os.environ["is_share"]=str(is_share) 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推理进程已开启") yield i18n("TTS推理进程已开启")
print(cmd) print(cmd)
p_tts_inference = Popen(cmd, shell=True) p_tts_inference = Popen(cmd, shell=True)