lj1995 commited on
Commit
d5b4469
1 Parent(s): 21fe39c

Update inference_webui.py

Browse files
Files changed (1) hide show
  1. inference_webui.py +12 -1
inference_webui.py CHANGED
@@ -19,6 +19,7 @@ logging.getLogger("torchaudio._extension").setLevel(logging.ERROR)
19
  logging.getLogger("multipart.multipart").setLevel(logging.ERROR)
20
  import LangSegment, os, re, sys, json
21
  import pdb
 
22
  import torch
23
 
24
  version="v2"#os.environ.get("version","v2")
@@ -341,6 +342,8 @@ def merge_short_text_in_array(texts, threshold):
341
  ##ref_wav_path+prompt_text+prompt_language+text(单个)+text_language+top_k+top_p+temperature
342
  # cache_tokens={}#暂未实现清理机制
343
  cache= {}
 
 
344
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
345
  global cache
346
  if ref_wav_path:pass
@@ -606,7 +609,15 @@ def html_left(text, label='p'):
606
 
607
  with gr.Blocks(title="GPT-SoVITS WebUI") as app:
608
  gr.Markdown(
609
- value=i18n("本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.")
 
 
 
 
 
 
 
 
610
  )
611
  with gr.Group():
612
  gr.Markdown(html_center(i18n("*请上传并填写参考信息"),'h3'))
 
19
  logging.getLogger("multipart.multipart").setLevel(logging.ERROR)
20
  import LangSegment, os, re, sys, json
21
  import pdb
22
+ import spaces
23
  import torch
24
 
25
  version="v2"#os.environ.get("version","v2")
 
342
  ##ref_wav_path+prompt_text+prompt_language+text(单个)+text_language+top_k+top_p+temperature
343
  # cache_tokens={}#暂未实现清理机制
344
  cache= {}
345
+ @torch.inference_mode()
346
+ @spaces.GPU
347
  def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
348
  global cache
349
  if ref_wav_path:pass
 
609
 
610
  with gr.Blocks(title="GPT-SoVITS WebUI") as app:
611
  gr.Markdown(
612
+ value="""# GPT-SoVITS-v2 Zero-shot TTS demo
613
+ ## https://github.com/RVC-Boss/GPT-SoVITS
614
+ Input 3~10s reference audio to guide the time-bre, speed, emotion of voice, and generate the speech you want by input the inference text.
615
+ 输入3~10秒的参考音频来引导待合成语音的音色、语速和情感,然后输入待合成目标文本,生成目标语音.
616
+ Cross-lingual Support: Inference in languages different from the training dataset, currently supporting English, Japanese, Korean and Cantonese.
617
+ 目前支持中日英韩粤跨语种合成。
618
+ This demo is open source under the MIT license. The author does not have any control over it. Users who use the software and distribute the sounds exported by the software are solely responsible. If you do not agree with this clause, you cannot use or reference any codes and files within this demo.
619
+ 本demo以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. 如不认可该条款, 则不能使用或引用该demo内的任何代码和文件.
620
+ """)
621
  )
622
  with gr.Group():
623
  gr.Markdown(html_center(i18n("*请上传并填写参考信息"),'h3'))