import spaces import gradio as gr import torch from TTS.api import TTS import os os.environ["COQUI_TOS_AGREED"] = "1" device = "cuda" tts = TTS("tts_models/multilingual/multi-dataset/xtts_bill_spa").to(device) def generateVoice(prompt): outputs = model.synthesize( "Hola amigos, bienvenidos a mi canal", config, speaker_wav="/guide_recording/guide.wav", gpt_cond_len=3, language="es", ) return outputs demo = gr.Interface( fn=generateVoice, inputs=["text"], outputs=["audio"], ) demo.launch()