Fix Glow-TTS multi-speaker inference

This commit is contained in:
Edresson Casanova 2022-02-18 19:25:29 +00:00
parent 06cad27e31
commit ba6e56e01c
1 changed files with 2 additions and 0 deletions

View File

@ -170,6 +170,8 @@ class GlowTTS(BaseTTS):
if g is not None:
if hasattr(self, "emb_g"):
# use speaker embedding layer
if not g.size(): # if is a scalar
g = g.unsqueeze(0) # unsqueeze
g = F.normalize(self.emb_g(g)).unsqueeze(-1) # [b, h, 1]
else:
# use d-vector