import os os.system('pip install gradio==2.3.0a0') os.system('pip freeze') import gradio as gr from subprocess import call def run_cmd(command): try: print(command) call(command) except KeyboardInterrupt: print("Process interrupted") sys.exit(1) def inference(text): cmd = ['tts', '--text', text] run_cmd(cmd) return 'tts_output.wav' inputs = gr.inputs.Textbox(lines=5, label="Input Text") outputs = gr.outputs.Audio(type="file",label="Output Audio") title = "coqui-ai-TTS" description = "Gradio demo for coqui-ai-TTS: a deep learning toolkit for Text-to-Speech, battle-tested in research and production. To use it, simply add your text, or click one of the examples to load them. Read more at the links below." article = "

TTS is a library for advanced Text-to-Speech generation | Github Repo

" examples = [ ["This is an open-source library that generates synthetic speech!"] ] gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=examples, enable_queue=True ).launch()