fix glow-tts prenet bug fix

This commit is contained in:
erogol 2020-12-28 13:51:15 +01:00
parent a1d5a9ddda
commit d62cac7252
1 changed files with 2 additions and 3 deletions

View File

@ -136,8 +136,7 @@ class Encoder(nn.Module):
x_mask = torch.unsqueeze(sequence_mask(x_lengths, x.size(2)),
1).to(x.dtype)
# pre-conv layers
if self.encoder_type in ['transformer', 'time-depth-separable']:
if self.use_prenet:
if hasattr(self, 'pre') and self.use_prenet:
x = self.pre(x, x_mask)
# encoder
x = self.encoder(x, x_mask)