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

set to device() in synthesise(); added print() dir to synthesise()

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -27,8 +27,9 @@ def translate(audio):
27
  def synthesise(text):
28
  inputs = tokenizer(text, return_tensors="pt")
29
  with torch.no_grad():
30
- output = model(**inputs).waveform
31
- return output.cpu()
 
32
 
33
 
34
  def speech_to_speech_translation(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):