Pass speaker manager to the model in synthesizer

This commit is contained in:
Eren Gölge 2021-10-20 18:11:36 +00:00
parent 588da1a24e
commit 0a3d1cc7ee
1 changed files with 3 additions and 3 deletions

View File

@ -107,12 +107,12 @@ class Synthesizer(object):
self.use_phonemes = self.tts_config.use_phonemes self.use_phonemes = self.tts_config.use_phonemes
self.ap = AudioProcessor(verbose=False, **self.tts_config.audio) self.ap = AudioProcessor(verbose=False, **self.tts_config.audio)
self.tts_model = setup_tts_model(config=self.tts_config) speaker_manager = self._init_speaker_manager()
self.tts_model = setup_tts_model(config=self.tts_config, speaker_manager=speaker_manager)
self.tts_model.load_checkpoint(self.tts_config, tts_checkpoint, eval=True) self.tts_model.load_checkpoint(self.tts_config, tts_checkpoint, eval=True)
if use_cuda: if use_cuda:
self.tts_model.cuda() self.tts_model.cuda()
speaker_manager = self._init_speaker_manager()
self.tts_model.speaker_manager = speaker_manager
def _init_speaker_manager(self): def _init_speaker_manager(self):
"""Initialize the SpeakerManager""" """Initialize the SpeakerManager"""