File size: 581 Bytes
70c7d97
 
 
 
 
 
 
 
 
 
 
994001b
70c7d97
 
 
 
 
 
 
 
 
 
 
 
ca027c3
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
import gradio as gr
from sbv2_bindings import TTSModel
from scipy.io import wavfile
import io


model = TTSModel.from_path("models/deberta.onnx", "models/tokenizer.json")
model.load_sbv2file_from_path("amitaro", "models/amitaro.sbv2")


def generate(text):
    wav_data = model.synthesize(text, "amitaro", 0, 0, 0.0, 0.5)
    byte_io = io.BytesIO(wav_data)
    sr, data = wavfile.read(byte_io)
    return sr, data


gradio_app = gr.Interface(
    fn=generate,
    inputs=["text"],
    outputs=[gr.Audio()],
)

if __name__ == "__main__":
    gradio_app.launch(server_name="0.0.0.0")