Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,116 Bytes
0ebcf15 fe7c793 0ebcf15 fe7c793 0ebcf15 fe7c793 d619292 fe7c793 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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()
|