File size: 581 Bytes
1785140
1945c48
1785140
 
 
 
1945c48
1785140
 
 
1945c48
6f17cca
 
b60f816
6f17cca
1945c48
 
6f17cca
 
 
1945c48
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

@spaces.GPU(enable_queue=True)
def clone(text, audio):
    tts.tts_to_file(text=text, speaker_wav=audio, language="es", file_path="./output.wav")
    return "./output.wav"

demo = gr.Interface(
    fn=clone, 
    inputs=[gr.Textbox(label='Frase a generar'), gr.Audio(type='filepath', label='Voz de referencia')], 
    outputs=gr.Audio(type='filepath')
)

demo.launch()