ClementXie commited on
Commit
7925a45
·
1 Parent(s): f99fbab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -29,7 +29,7 @@ def translate(audio):
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 gr.Audio.update(value=(16000, speech.cpu().numpy()))
33
 
34
 
35
  def speech_to_speech_translation(audio):
@@ -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
  )
 
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
 
34
 
35
  def speech_to_speech_translation(audio):
 
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
  )