import gradio as gr import torch.cuda from InferenceInterfaces.ControllableInterface import ControllableInterface from Utility.utils import float2pcm import spaces gpu_id="cuda" controllable_ui = ControllableInterface(gpu_id=gpu_id) @spaces.GPU def read(self, prompt): sr, wav = controllable_ui.read(prompt, -24.) return sr, float2pcm(wav) iface = gr.Interface(fn=read, inputs=[gr.Textbox(lines=2, placeholder="write what you want the synthesis to read here...", value="What I cannot create, I do not understand.", label="Text input", max_length=400)], outputs=[gr.Audio(type="numpy", label="Speech")], title="Simplistic Stochastic Speech Synthesis with ToucanTTS", theme="default", allow_flagging="never", article="This space is purely optimized for English. For a multilingual version, have a look at https://huggingface.co/spaces/Flux9665/MassivelyMultilingualTTS") iface.launch()