ClementXie commited on
Commit
3fadf8a
·
1 Parent(s): 943d242

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,7 +27,7 @@ def translate(audio):
27
 
28
 
29
  def synthesise(text):
30
- inputs = processor(text=text, return_tensors="pt")
31
  speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
32
  return speech.cpu()
33
 
@@ -60,7 +60,7 @@ file_translate = gr.Interface(
60
  fn=speech_to_speech_translation,
61
  inputs=gr.Audio(source="upload", type="filepath"),
62
  outputs=gr.Audio(label="Generated Speech", type="numpy"),
63
- # examples=[["./example.wav"]],
64
  title=title,
65
  description=description,
66
  )
 
27
 
28
 
29
  def synthesise(text):
30
+ inputs = processor(text=text, max_length=600, truncation=True, return_tensors="pt")
31
  speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
32
  return speech.cpu()
33
 
 
60
  fn=speech_to_speech_translation,
61
  inputs=gr.Audio(source="upload", type="filepath"),
62
  outputs=gr.Audio(label="Generated Speech", type="numpy"),
63
+ examples=[["./example.wav"]],
64
  title=title,
65
  description=description,
66
  )