mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 23:48:48 +08:00
simplify modification
This commit is contained in:
parent
71edcd6ab0
commit
f5a96d46d4
@ -125,7 +125,6 @@ if os.path.exists(txt_path) == False:
|
|||||||
print(f"\033[33m[Waring] The {language = } of {wav_name} is not supported for training.\033[0m")
|
print(f"\033[33m[Waring] The {language = } of {wav_name} is not supported for training.\033[0m")
|
||||||
except:
|
except:
|
||||||
print(line, traceback.format_exc())
|
print(line, traceback.format_exc())
|
||||||
assert len(todo) > 0, f"\033[31m[Error] Part {i_part}: No data loaded from {inp_text}.\033[0m"
|
|
||||||
process(todo, res)
|
process(todo, res)
|
||||||
opt = []
|
opt = []
|
||||||
for name, phones, word2ph, norm_text in res:
|
for name, phones, word2ph, norm_text in res:
|
||||||
|
18
webui.py
18
webui.py
@ -411,15 +411,14 @@ def open1a(inp_text,inp_wav_dir,exp_name,gpu_numbers,bert_pretrained_dir):
|
|||||||
opt = []
|
opt = []
|
||||||
for i_part in range(all_parts):
|
for i_part in range(all_parts):
|
||||||
txt_path = "%s/2-name2text-%s.txt" % (opt_dir, i_part)
|
txt_path = "%s/2-name2text-%s.txt" % (opt_dir, i_part)
|
||||||
if os.path.exists(txt_path):
|
with open(txt_path, "r", encoding="utf8") as f:
|
||||||
with open(txt_path, "r", encoding="utf8") as f:
|
opt += f.read().strip("\n").split("\n")
|
||||||
opt += f.read().strip("\n").split("\n")
|
os.remove(txt_path)
|
||||||
os.remove(txt_path)
|
|
||||||
path_text = "%s/2-name2text.txt" % opt_dir
|
path_text = "%s/2-name2text.txt" % opt_dir
|
||||||
with open(path_text, "w", encoding="utf8") as f:
|
with open(path_text, "w", encoding="utf8") as f:
|
||||||
f.write("\n".join(opt) + "\n")
|
f.write("\n".join(opt) + "\n")
|
||||||
ps1a=[]
|
ps1a=[]
|
||||||
if len(opt) > 0:
|
if len("".join(opt)) > 0:
|
||||||
yield "文本进程成功", {"__type__": "update", "visible": True}, {"__type__": "update", "visible": False}
|
yield "文本进程成功", {"__type__": "update", "visible": True}, {"__type__": "update", "visible": False}
|
||||||
else:
|
else:
|
||||||
yield "文本进程失败", {"__type__": "update", "visible": True}, {"__type__": "update", "visible": False}
|
yield "文本进程失败", {"__type__": "update", "visible": True}, {"__type__": "update", "visible": False}
|
||||||
@ -582,13 +581,12 @@ def open1abc(inp_text,inp_wav_dir,exp_name,gpu_numbers1a,gpu_numbers1Ba,gpu_numb
|
|||||||
opt = []
|
opt = []
|
||||||
for i_part in range(all_parts):#txt_path="%s/2-name2text-%s.txt"%(opt_dir,i_part)
|
for i_part in range(all_parts):#txt_path="%s/2-name2text-%s.txt"%(opt_dir,i_part)
|
||||||
txt_path = "%s/2-name2text-%s.txt" % (opt_dir, i_part)
|
txt_path = "%s/2-name2text-%s.txt" % (opt_dir, i_part)
|
||||||
if os.path.exists(txt_path):
|
with open(txt_path, "r",encoding="utf8") as f:
|
||||||
with open(txt_path, "r",encoding="utf8") as f:
|
opt += f.read().strip("\n").split("\n")
|
||||||
opt += f.read().strip("\n").split("\n")
|
os.remove(txt_path)
|
||||||
os.remove(txt_path)
|
|
||||||
with open(path_text, "w",encoding="utf8") as f:
|
with open(path_text, "w",encoding="utf8") as f:
|
||||||
f.write("\n".join(opt) + "\n")
|
f.write("\n".join(opt) + "\n")
|
||||||
assert len(opt) > 0, "1Aa-文本获取进程失败"
|
assert len("".join(opt)) > 0, "1Aa-文本获取进程失败"
|
||||||
yield "进度:1a-done", {"__type__": "update", "visible": False}, {"__type__": "update", "visible": True}
|
yield "进度:1a-done", {"__type__": "update", "visible": False}, {"__type__": "update", "visible": True}
|
||||||
ps1abc=[]
|
ps1abc=[]
|
||||||
#############################1b
|
#############################1b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user