Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -161,9 +161,9 @@ def get_spepc(hps, filename):
|
|
161 |
|
162 |
|
163 |
dict_language={
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
}
|
168 |
|
169 |
|
@@ -241,8 +241,7 @@ def nonen_get_bert_inf(text, language):
|
|
241 |
|
242 |
return bert
|
243 |
|
244 |
-
|
245 |
-
def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language,how_to_cut=i18n("不切")):
|
246 |
t0 = ttime()
|
247 |
prompt_text = prompt_text.strip("\n")
|
248 |
prompt_language, text = prompt_language, text.strip("\n")
|
@@ -276,10 +275,10 @@ def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language,
|
|
276 |
phones1, word2ph1, norm_text1 = clean_text_inf(prompt_text, prompt_language)
|
277 |
else:
|
278 |
phones1, word2ph1, norm_text1 = nonen_clean_text_inf(prompt_text, prompt_language)
|
279 |
-
if(how_to_cut==
|
280 |
-
elif(how_to_cut==
|
281 |
-
elif(how_to_cut==
|
282 |
-
elif(how_to_cut==
|
283 |
text = text.replace("\n\n","\n").replace("\n\n","\n").replace("\n\n","\n")
|
284 |
if(text[-1]not in splits):text+="。"if text_language!="en"else "."
|
285 |
texts=text.split("\n")
|
@@ -459,7 +458,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app:
|
|
459 |
### <center>⚠️在线端不稳定且生成速度较慢,强烈建议下载模型本地推理!\n
|
460 |
""")
|
461 |
# with gr.Tabs():
|
462 |
-
|
463 |
with gr.Group():
|
464 |
gr.Markdown(value="*参考音频选择(必选)")
|
465 |
with gr.Row():
|
|
|
161 |
|
162 |
|
163 |
dict_language={
|
164 |
+
("中文"):"zh",
|
165 |
+
("英文"):"en",
|
166 |
+
("日文"):"ja"
|
167 |
}
|
168 |
|
169 |
|
|
|
241 |
|
242 |
return bert
|
243 |
|
244 |
+
def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language,how_to_cut=("不切")):
|
|
|
245 |
t0 = ttime()
|
246 |
prompt_text = prompt_text.strip("\n")
|
247 |
prompt_language, text = prompt_language, text.strip("\n")
|
|
|
275 |
phones1, word2ph1, norm_text1 = clean_text_inf(prompt_text, prompt_language)
|
276 |
else:
|
277 |
phones1, word2ph1, norm_text1 = nonen_clean_text_inf(prompt_text, prompt_language)
|
278 |
+
if(how_to_cut==("凑五句一切")):text=cut1(text)
|
279 |
+
elif(how_to_cut==("凑50字一切")):text=cut2(text)
|
280 |
+
elif(how_to_cut==("按中文句号。切")):text=cut3(text)
|
281 |
+
elif(how_to_cut==("按英文句号.切")):text=cut4(text)
|
282 |
text = text.replace("\n\n","\n").replace("\n\n","\n").replace("\n\n","\n")
|
283 |
if(text[-1]not in splits):text+="。"if text_language!="en"else "."
|
284 |
texts=text.split("\n")
|
|
|
458 |
### <center>⚠️在线端不稳定且生成速度较慢,强烈建议下载模型本地推理!\n
|
459 |
""")
|
460 |
# with gr.Tabs():
|
461 |
+
|
462 |
with gr.Group():
|
463 |
gr.Markdown(value="*参考音频选择(必选)")
|
464 |
with gr.Row():
|