jaymanvirk commited on
Commit
ddedf71
1 Parent(s): 517bcc3

replaced waveform with .audio[0]

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,9 +27,9 @@ def translate(audio):
27
  def synthesise(text):
28
  inputs = tokenizer(text, return_tensors="pt")
29
  with torch.no_grad():
30
- speech = model(inputs["input_ids"].to(device))
31
- print(dir(speech))
32
- return speech.waveform
33
 
34
 
35
  def speech_to_speech_translation(audio):
 
27
  def synthesise(text):
28
  inputs = tokenizer(text, return_tensors="pt")
29
  with torch.no_grad():
30
+ output = model(inputs["input_ids"].to(device))
31
+ speech = output.audio[0]
32
+ return speech.cpu()
33
 
34
 
35
  def speech_to_speech_translation(audio):