Spaces:
Sleeping
Sleeping
Primera version
Browse files- app.py +18 -0
- requirements.txt +2 -0
app.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()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
torch
|