crcdng commited on
Commit
c62d02b
1 Parent(s): e42c670

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -32,7 +32,11 @@ def translate(audio):
32
  def synthesise(text):
33
  inputs = tokenizer(text, return_tensors="pt")
34
  # inputs = processor(text=text, return_tensors="pt")
35
- speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
 
 
 
 
36
  return speech.cpu()
37
 
38
 
 
32
  def synthesise(text):
33
  inputs = tokenizer(text, return_tensors="pt")
34
  # inputs = processor(text=text, return_tensors="pt")
35
+ with torch.no_grad():
36
+ outputs = model(inputs["input_ids"])
37
+
38
+ speech = outputs.audio[0]
39
+ # speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
40
  return speech.cpu()
41
 
42