ismaeltorres00 commited on
Commit
a98b07d
·
verified ·
1 Parent(s): 63fefa8

Create app3.py

Browse files
Files changed (1) hide show
  1. app3.py +18 -0
app3.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipe = pipeline("text-to-speech", model="suno/bark-small")
5
+
6
+ def tts(frase):
7
+ audio_generated = pipe(frase)
8
+
9
+ return audio_generated["sampling_rate"],audio_generated["audio"][0]
10
+
11
+ demo = gr.Interface(
12
+ tts,
13
+ inputs=gr.Text(label="Teclea el texto a pronunciar"),
14
+ outputs=gr.Audio(label="audio generado"),
15
+ title="De texto a voz",
16
+ )
17
+
18
+ demo.launch()