OuroborosM commited on
Commit
21842d6
·
1 Parent(s): ffb657e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -96,15 +96,15 @@ def speech_to_text_loc(audio):
96
 
97
  print("voice to text loc: ", speech_to_text_loc(sample))
98
 
99
- def text_to_speech_loc(audio):
100
  device = "cpu"
101
  pipe = pipeline(
102
  "text-to-speech",
103
  model="microsoft/speecht5_tts",
104
  device=device,
105
  )
106
- text = pipe(audio.copy(), batch_size=2)["text"]
107
- return text
108
 
109
  print("text to speech: ", text_to_speech_loc("Good morning."))
110
 
 
96
 
97
  print("voice to text loc: ", speech_to_text_loc(sample))
98
 
99
+ def text_to_speech_loc(text):
100
  device = "cpu"
101
  pipe = pipeline(
102
  "text-to-speech",
103
  model="microsoft/speecht5_tts",
104
  device=device,
105
  )
106
+ audio = pipe(text)["audio"]
107
+ return audio
108
 
109
  print("text to speech: ", text_to_speech_loc("Good morning."))
110