DanGalt commited on
Commit
cbb24fb
·
1 Parent(s): fcddf8c

fix bug if text is too large

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -29,6 +29,8 @@ def translate(audio):
29
 
30
  def synthesise(text):
31
  inputs = processor(text=text, return_tensors="pt")
 
 
32
  speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
33
  return speech.cpu()
34
 
 
29
 
30
  def synthesise(text):
31
  inputs = processor(text=text, return_tensors="pt")
32
+ if inputs.shape[0] > 600:
33
+ inputs = inputs[:600]
34
  speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
35
  return speech.cpu()
36