Skip to content

Commit

Permalink
Update SpeakerManager init in Synthesizer
Browse files Browse the repository at this point in the history
  • Loading branch information
erogol committed May 11, 2022
1 parent c3f8c4d commit 2fc38f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions TTS/utils/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ def _load_tts(self, tts_checkpoint: str, tts_config_path: str, use_cuda: bool) -
"""Load the TTS model.
1. Load the model config.
2. Init the AudioProcessor.
3. Init the model from the config.
2. Init the model from the config.
3. Load the model weights.
4. Move the model to the GPU if CUDA is enabled.
5. Init the speaker manager for the model.
5. Init the speaker manager in the model.
Args:
tts_checkpoint (str): path to the model checkpoint.
Expand All @@ -122,8 +122,7 @@ def _load_tts(self, tts_checkpoint: str, tts_config_path: str, use_cuda: bool) -
self.tts_model.cuda()

if self.encoder_checkpoint and hasattr(self.tts_model, "speaker_manager"):
self.tts_model.speaker_manager.use_cuda = use_cuda
self.tts_model.speaker_manager.init_encoder(self.encoder_checkpoint, self.encoder_config)
self.tts_model.speaker_manager.init_encoder(self.encoder_checkpoint, self.encoder_config, use_cuda)

def _set_speaker_encoder_paths_from_tts_config(self):
"""Set the encoder paths from the tts model config for models with speaker encoders."""
Expand Down

0 comments on commit 2fc38f6

Please sign in to comment.