Plachta commited on
Commit
c950f76
1 Parent(s): f9f36e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -43,6 +43,7 @@ This synthesizer is created based on VITS (https://arxiv.org/abs/2106.06103) mod
43
  If your input language is not Japanese, it will be translated to Japanese by Google translator, but accuracy is not guaranteed.\n
44
  如果您的输入语言不是日语,则会由谷歌翻译自动翻译为日语,但是准确性不能保证。\n\n
45
  若使用人数太多可能会出现排队过久的情况,若有需要可选择本地部署
 
46
  """
47
  article = """
48
 
@@ -50,6 +51,8 @@ article = """
50
 
51
 
52
  def infer(text, character, language, duration, noise_scale, noise_scale_w):
 
 
53
  if language == '日本語':
54
  pass
55
  elif language == '简体中文':
@@ -66,7 +69,7 @@ def infer(text, character, language, duration, noise_scale, noise_scale_w):
66
  return (text,(22050, audio))
67
 
68
  # We instantiate the Textbox class
69
- textbox = gr.Textbox(label="Text", placeholder="Type your sentence here", lines=2)
70
  # select character
71
  char_dropdown = gr.Dropdown(['0:特别周','1:无声铃鹿','2:东海帝王','3:丸善斯基',
72
  '4:富士奇迹','5:小栗帽','6:黄金船','7:伏特加',
 
43
  If your input language is not Japanese, it will be translated to Japanese by Google translator, but accuracy is not guaranteed.\n
44
  如果您的输入语言不是日语,则会由谷歌翻译自动翻译为日语,但是准确性不能保证。\n\n
45
  若使用人数太多可能会出现排队过久的情况,若有需要可选择本地部署
46
+ 为了避免内存不足导致环境崩掉,建议不要输入太长的段落。
47
  """
48
  article = """
49
 
 
51
 
52
 
53
  def infer(text, character, language, duration, noise_scale, noise_scale_w):
54
+ if len(text)>1000:
55
+ text = text[:1000]
56
  if language == '日本語':
57
  pass
58
  elif language == '简体中文':
 
69
  return (text,(22050, audio))
70
 
71
  # We instantiate the Textbox class
72
+ textbox = gr.Textbox(label="Text", placeholder="Type your sentence here (maximum 1000 characters)", lines=2)
73
  # select character
74
  char_dropdown = gr.Dropdown(['0:特别周','1:无声铃鹿','2:东海帝王','3:丸善斯基',
75
  '4:富士奇迹','5:小栗帽','6:黄金船','7:伏特加',