WasuratS commited on
Commit
4c9dab2
·
1 Parent(s): a8daa18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -24,11 +24,8 @@ def translate(audio):
24
  return outputs['text']
25
 
26
  def synthesise(text):
27
- inputs = tokenizer(text, return_tensors="pt")
28
- with torch.no_grad():
29
- outputs = model(inputs["input_ids"])
30
- speech = outputs.audio[0]
31
-
32
  return speech.cpu()
33
 
34
  def speech_to_speech_translation(audio):
 
24
  return outputs['text']
25
 
26
  def synthesise(text):
27
+ inputs = processor(text=text, return_tensors="pt")
28
+ speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
 
 
 
29
  return speech.cpu()
30
 
31
  def speech_to_speech_translation(audio):