mirror of https://github.com/coqui-ai/TTS.git
fix: only compute spk embeddings for models that support it
Fixes #1440. Passing a `speaker_wav` argument to regular Vits models failed because they don't support voice cloning. Now that argument is simply ignored.
This commit is contained in:
parent
cde319874e
commit
2d45cc73ae
|
@ -358,7 +358,11 @@ class Synthesizer(nn.Module):
|
||||||
)
|
)
|
||||||
|
|
||||||
# compute a new d_vector from the given clip.
|
# compute a new d_vector from the given clip.
|
||||||
if speaker_wav is not None and self.tts_model.speaker_manager is not None:
|
if (
|
||||||
|
speaker_wav is not None
|
||||||
|
and self.tts_model.speaker_manager is not None
|
||||||
|
and self.tts_model.speaker_manager.encoder_ap is not None
|
||||||
|
):
|
||||||
speaker_embedding = self.tts_model.speaker_manager.compute_embedding_from_clip(speaker_wav)
|
speaker_embedding = self.tts_model.speaker_manager.compute_embedding_from_clip(speaker_wav)
|
||||||
|
|
||||||
vocoder_device = "cpu"
|
vocoder_device = "cpu"
|
||||||
|
|
Loading…
Reference in New Issue