File size: 1,070 Bytes
0ebcf15
 
 
 
 
fe7c793
0ebcf15
fe7c793
 
0ebcf15
fe7c793
603b9ec
fe7c793
 
 
 
 
 
 
5413f24
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
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(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")],
                    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()