mirror of https://github.com/coqui-ai/TTS.git
Merge pull request #3058 from coqui-ai/spkr_enc_3020
fixed bugs in fastpitch tts synthesis
This commit is contained in:
commit
b25d96ecee
|
@ -396,6 +396,7 @@ class ForwardTTS(BaseTTS):
|
||||||
- g: :math:`(B, C)`
|
- g: :math:`(B, C)`
|
||||||
"""
|
"""
|
||||||
if hasattr(self, "emb_g"):
|
if hasattr(self, "emb_g"):
|
||||||
|
g = g.type(torch.LongTensor)
|
||||||
g = self.emb_g(g) # [B, C, 1]
|
g = self.emb_g(g) # [B, C, 1]
|
||||||
if g is not None:
|
if g is not None:
|
||||||
g = g.unsqueeze(-1)
|
g = g.unsqueeze(-1)
|
||||||
|
@ -683,9 +684,10 @@ class ForwardTTS(BaseTTS):
|
||||||
# encoder pass
|
# encoder pass
|
||||||
o_en, x_mask, g, _ = self._forward_encoder(x, x_mask, g)
|
o_en, x_mask, g, _ = self._forward_encoder(x, x_mask, g)
|
||||||
# duration predictor pass
|
# duration predictor pass
|
||||||
o_dr_log = self.duration_predictor(o_en, x_mask)
|
o_dr_log = self.duration_predictor(o_en.squeeze(), x_mask)
|
||||||
o_dr = self.format_durations(o_dr_log, x_mask).squeeze(1)
|
o_dr = self.format_durations(o_dr_log, x_mask).squeeze(1)
|
||||||
y_lengths = o_dr.sum(1)
|
y_lengths = o_dr.sum(1)
|
||||||
|
|
||||||
# pitch predictor pass
|
# pitch predictor pass
|
||||||
o_pitch = None
|
o_pitch = None
|
||||||
if self.args.use_pitch:
|
if self.args.use_pitch:
|
||||||
|
|
Loading…
Reference in New Issue