Yurii Paniv commited on
Commit
890295c
1 Parent(s): 64b36a1

Limit text length to mitigate crashes

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -44,6 +44,7 @@ for MODEL_NAME in MODEL_NAMES:
44
 
45
 
46
  def tts(text: str, model_name: str):
 
47
  print(text, model_name)
48
  synthesizer = MODELS.get(model_name, None)
49
  if synthesizer is None:
 
44
 
45
 
46
  def tts(text: str, model_name: str):
47
+ text = text if len(text) < 500 else text[0:500] # mitigate crashes on hf space
48
  print(text, model_name)
49
  synthesizer = MODELS.get(model_name, None)
50
  if synthesizer is None: