File size: 395 Bytes
32e218a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
from TTS.api import TTS
tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=False)
def predict(text):
file_path = "output.wav"
tts.tts_to_file(text, speaker=tts.speakers[0], language="en", file_path=file_path)
return file_path
demo = gr.Interface(
fn=predict,
input='text',
output='audio'
)
demo.launch() |