@@ -30,6 +30,8 @@ def __init__(
30
30
vocoder_config_path : Optional [str ] = None ,
31
31
encoder_path : Optional [str ] = None ,
32
32
encoder_config_path : Optional [str ] = None ,
33
+ speakers_file_path : Optional [str ] = None ,
34
+ language_ids_file_path : Optional [str ] = None ,
33
35
progress_bar : bool = True ,
34
36
gpu : bool = False ,
35
37
) -> None :
@@ -68,8 +70,10 @@ def __init__(
68
70
vocoder_config_path (str, optional): Path to the vocoder config. Defaults to None.
69
71
encoder_path: Path to speaker encoder checkpoint. Default to None.
70
72
encoder_config_path: Path to speaker encoder config file. Defaults to None.
71
- progress_bar (bool, optional): Whether to pring a progress bar while downloading a model. Defaults to True.
72
- gpu (bool, optional): Enable/disable GPU. Some models might be too slow on CPU. Defaults to False.
73
+ speakers_file_path: JSON file for multi-speaker model. Defaults to None.
74
+ language_ids_file_path: JSON file for multilingual model. Defaults to None
75
+ progress_bar (bool, optional): Whether to print a progress bar while downloading a model. Defaults to True.
76
+ gpu (bool, optional): Enable/disable GPU. Defaults to False. DEPRECATED, use TTS(...).to("cuda")
73
77
"""
74
78
super ().__init__ ()
75
79
self .manager = ModelManager (models_file = self .get_models_file_path (), progress_bar = progress_bar )
@@ -82,6 +86,8 @@ def __init__(
82
86
self .vocoder_config_path = vocoder_config_path
83
87
self .encoder_path = encoder_path
84
88
self .encoder_config_path = encoder_config_path
89
+ self .speakers_file_path = speakers_file_path
90
+ self .language_ids_file_path = language_ids_file_path
85
91
86
92
if gpu :
87
93
warnings .warn ("`gpu` will be deprecated. Please use `tts.to(device)` instead." )
@@ -226,8 +232,8 @@ def load_tts_model_by_path(self, model_path: str, config_path: str, *, gpu: bool
226
232
self .synthesizer = Synthesizer (
227
233
tts_checkpoint = model_path ,
228
234
tts_config_path = config_path ,
229
- tts_speakers_file = None ,
230
- tts_languages_file = None ,
235
+ tts_speakers_file = self . speakers_file_path ,
236
+ tts_languages_file = self . language_ids_file_path ,
231
237
vocoder_checkpoint = self .vocoder_path ,
232
238
vocoder_config = self .vocoder_config_path ,
233
239
encoder_checkpoint = self .encoder_path ,
0 commit comments