clementruhm commited on
Commit
6ebe60a
1 Parent(s): 86fe2ba

app.py: cut off, if the input is too long

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -89,6 +89,8 @@ def main():
89
  logging.info("text or speaker are not provided")
90
  return None
91
  global tts
 
 
92
  samples = cast(TTS, tts).synthesize(text_str, speaker_str)
93
  return gr.Audio.update(value=(24000, samples))
94
 
 
89
  logging.info("text or speaker are not provided")
90
  return None
91
  global tts
92
+ if len(text_str) > 1024:
93
+ text_str = text_str[:1024]
94
  samples = cast(TTS, tts).synthesize(text_str, speaker_str)
95
  return gr.Audio.update(value=(24000, samples))
96