vladelesin commited on
Commit
cbeee19
1 Parent(s): bcc1813

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -37,9 +37,8 @@ def synthesise(text):
37
  speech = model.generate(**tokenizer(translated_text, return_tensors="pt"))
38
  return speech.to("cpu")
39
 
40
- def speech_to_speech_translation(audio):
41
- translated_text = translate(audio)
42
- synthesised_speech = synthesise(translated_text)
43
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
44
  return 16000, synthesised_speech[0]
45
 
 
37
  speech = model.generate(**tokenizer(translated_text, return_tensors="pt"))
38
  return speech.to("cpu")
39
 
40
+ def speech_to_speech_translation(text):
41
+ synthesised_speech = synthesise(text)
 
42
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
43
  return 16000, synthesised_speech[0]
44