forked from sovaai/sova-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
29 lines (22 loc) · 818 Bytes
/
models.py
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
from tts.synthesizer import Synthesizer, set_logger
ALL_MODELS = "all"
config = Synthesizer.load_config("config.yaml")
set_logger(**config["general"].pop("logging"))
natasha = Synthesizer.from_config(config, name="natasha")
ruslan_config = config["ruslan"]
ruslan = Synthesizer(
name="ruslan",
text_handler=natasha.text_handler,
engine=Synthesizer.module_from_config(ruslan_config, "engine", "tacotron2", natasha.device),
vocoder=Synthesizer.module_from_config(ruslan_config, "vocoder", "waveglow", natasha.device),
sample_rate=natasha.sample_rate,
device=natasha.device,
pause_type=natasha.pause_type,
voice_control_cfg=ruslan_config["voice_control_cfg"],
user_dict=ruslan_config["user_dict"]
)
models = {
"Natasha": natasha,
"Ruslan": ruslan,
ALL_MODELS: None
}