Skip to content

Commit

Permalink
Merge pull request #3058 from coqui-ai/spkr_enc_3020
Browse files Browse the repository at this point in the history
fixed bugs in fastpitch tts synthesis
  • Loading branch information
erogol authored Oct 14, 2023
2 parents 9963519 + ffddf10 commit b25d96e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TTS/tts/models/forward_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def _forward_encoder(
- g: :math:`(B, C)`
"""
if hasattr(self, "emb_g"):
g = g.type(torch.LongTensor)
g = self.emb_g(g) # [B, C, 1]
if g is not None:
g = g.unsqueeze(-1)
Expand Down Expand Up @@ -683,9 +684,10 @@ def inference(self, x, aux_input={"d_vectors": None, "speaker_ids": None}): # p
# encoder pass
o_en, x_mask, g, _ = self._forward_encoder(x, x_mask, g)
# 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)
y_lengths = o_dr.sum(1)

# pitch predictor pass
o_pitch = None
if self.args.use_pitch:
Expand Down

0 comments on commit b25d96e

Please sign in to comment.