Spaces:
Runtime error
Runtime error
fix bug if text is too large
Browse files
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 |
|