Spaces:
Sleeping
Sleeping
levantando la app en hugging face text2speech with gradio
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import tempfile
|
2 |
+
import gradio as gr
|
3 |
+
import pytesseract
|
4 |
+
from gtts import gTTS
|
5 |
+
|
6 |
+
def text_to_speech(inputs):
|
7 |
+
text = inputs
|
8 |
+
speech = gTTS(text)
|
9 |
+
speech.save("prueba.mp3")
|
10 |
+
return "prueba.mp3", text
|
11 |
+
|
12 |
+
|
13 |
+
outputs = [gr.Audio(label="Output"), "text"]
|
14 |
+
|
15 |
+
demo = gr.Interface(fn=text_to_speech,
|
16 |
+
inputs="text",
|
17 |
+
outputs=outputs,
|
18 |
+
)
|
19 |
+
|
20 |
+
demo.launch()
|