File size: 689 Bytes
ae14a36
8e3a6c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3dd4456
8e3a6c8
 
 
 
 
 
 
ae14a36
 
 
 
 
8e3a6c8
ae14a36
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
29
30
31
32
33
import gradio as gr
from TTS.config import load_config
from TTS.utils.manage import ModelManager
from TTS.utils.synthesizer import Synthesizer

model_path = "./model/model.pht"
config_path = "./model/config.json"

synthesizer = Synthesizer(
    tts_checkpoint=model_path,
    tts_config_path=config_path,
    tts_speakers_file=None,
    tts_languages_file=None,
    vocoder_checkpoint=None,
    vocoder_config=None,
    encoder_checkpoint="",
    encoder_config="",
    use_cuda=False,
)

def run_tts(text):

    wav = synthesizer.tts(text)

    return wav

def greet(name):
    return "Hello " + name + "!!"


iface = gr.Interface(fn=greet, inputs="text", outputs="audio")
iface.launch()