fix the app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,9 @@ import tempfile
|
|
| 5 |
|
| 6 |
def speak(text):
|
| 7 |
tts = gTTS(text)
|
| 8 |
-
with
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
return tmp.name
|
| 12 |
|
| 13 |
-
app = gr.Interface(fn=speak, inputs="text", outputs="audio", title="
|
| 14 |
app.launch()
|
|
|
|
| 5 |
|
| 6 |
def speak(text):
|
| 7 |
tts = gTTS(text)
|
| 8 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp:
|
| 9 |
+
tts.save(tmp.name)
|
| 10 |
+
return tmp.name
|
|
|
|
| 11 |
|
| 12 |
+
app = gr.Interface(fn=speak, inputs="text", outputs="audio", title="Avinash's TTS App")
|
| 13 |
app.launch()
|