ygutierrez commited on
Commit
2e5d111
·
verified ·
1 Parent(s): dcaad65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -8
app.py CHANGED
@@ -1,9 +1,20 @@
1
  from TTS.api import TTS
2
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
3
-
4
- # generate speech by cloning a voice using default settings
5
- tts.tts_to_file(text="It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.",
6
- file_path="output.wav",
7
- speaker_wav="/path/to/target/speaker.wav",
8
- language="en")
9
-
 
 
 
 
 
 
 
 
 
 
 
 
1
  from TTS.api import TTS
2
+
3
+ # Cargar el modelo Coqui XTTS v2.0.3
4
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2.0.3", gpu=False)
5
+
6
+ def text_to_speech(text):
7
+ output_path = "output.wav"
8
+ tts.tts_to_file(text=text, file_path=output_path)
9
+ return output_path
10
+
11
+ # Interfaz con Gradio
12
+ demo = gr.Interface(
13
+ fn=text_to_speech,
14
+ inputs=gr.Textbox(label="Ingrese el texto"),
15
+ outputs=gr.Audio(label="Audio generado"),
16
+ title="Conversión de Texto a Voz con Coqui XTTS v2.0.3",
17
+ description="Ingrese un texto y escuche el audio generado utilizando el modelo XTTS v2.0.3 de Coqui."
18
+ )
19
+
20
+ demo.launch()