XzJosh commited on
Commit
c11584c
1 Parent(s): 6ae47ab

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -161,9 +161,9 @@ def get_spepc(hps, filename):
161
 
162
 
163
  dict_language={
164
- i18n("中文"):"zh",
165
- i18n("英文"):"en",
166
- i18n("日文"):"ja"
167
  }
168
 
169
 
@@ -241,8 +241,7 @@ def nonen_get_bert_inf(text, language):
241
 
242
  return bert
243
 
244
- #i18n("不切"),i18n("凑五句一切"),i18n("凑50字一切"),i18n("按中文句号。切"),i18n("按英文句号.切")
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==i18n("凑五句一切")):text=cut1(text)
280
- elif(how_to_cut==i18n("凑50字一切")):text=cut2(text)
281
- elif(how_to_cut==i18n("按中文句号。切")):text=cut3(text)
282
- elif(how_to_cut==i18n("按英文句号.切")):text=cut4(text)
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
- # with gr.TabItem(i18n("伴奏人声分离&去混响&去回声")):
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():