mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 23:48:48 +08:00
Filter unsupported languages
This commit is contained in:
parent
82a5672361
commit
0e08f12bed
@ -117,12 +117,15 @@ if os.path.exists(txt_path) == False:
|
|||||||
try:
|
try:
|
||||||
wav_name, spk_name, language, text = line.split("|")
|
wav_name, spk_name, language, text = line.split("|")
|
||||||
# todo.append([name,text,"zh"])
|
# todo.append([name,text,"zh"])
|
||||||
todo.append(
|
if language in language_v1_to_language_v2.keys():
|
||||||
[wav_name, text, language_v1_to_language_v2.get(language, language)]
|
todo.append(
|
||||||
)
|
[wav_name, text, language_v1_to_language_v2.get(language, language)]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
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:
|
||||||
|
7
webui.py
7
webui.py
@ -411,9 +411,10 @@ 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)
|
||||||
with open(txt_path, "r", encoding="utf8") as f:
|
if os.path.exists(txt_path):
|
||||||
opt += f.read().strip("\n").split("\n")
|
with open(txt_path, "r", encoding="utf8") as f:
|
||||||
os.remove(txt_path)
|
opt += f.read().strip("\n").split("\n")
|
||||||
|
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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user