Csuarezg commited on
Commit
1f16f30
1 Parent(s): 7a8ea90

levantando la app en hugging face text2speech with gradio

Browse files
Files changed (1) hide show
  1. app.py +20 -0
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()