Spaces:
Runtime error
Runtime error
Commit
·
21842d6
1
Parent(s):
ffb657e
Update app.py
Browse files
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(
|
100 |
device = "cpu"
|
101 |
pipe = pipeline(
|
102 |
"text-to-speech",
|
103 |
model="microsoft/speecht5_tts",
|
104 |
device=device,
|
105 |
)
|
106 |
-
|
107 |
-
return
|
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 |
|