Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prophesier committed Nov 29, 2022
1 parent bad7022 commit 88c439a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/fastspeech/fs2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, dictionary, out_dims=None):
super().__init__()
# self.dictionary = dictionary
self.padding_idx = 0
if 'no_fs2' in hparams.keys() and not hparams['no_fs2']:
if hparams['no_fs2'] if 'no_fs2' in hparams.keys() else True:
self.enc_layers = hparams['enc_layers']
self.dec_layers = hparams['dec_layers']
self.encoder = FS_ENCODERS[hparams['encoder_type']](hparams)
Expand Down Expand Up @@ -95,7 +95,7 @@ def forward(self, hubert, mel2ph=None, spk_embed=None,
ref_mels=None, f0=None, uv=None, energy=None, skip_decoder=True,
spk_embed_dur_id=None, spk_embed_f0_id=None, infer=False, **kwargs):
ret = {}
if 'no_fs2' in hparams.keys() and not hparams['no_fs2']:
if hparams['no_fs2'] if 'no_fs2' in hparams.keys() else True:
encoder_out =self.encoder(hubert) # [B, T, C]
else:
encoder_out =hubert
Expand Down Expand Up @@ -146,7 +146,7 @@ def forward(self, hubert, mel2ph=None, spk_embed=None,
decoder_inp = decoder_inp + self.add_energy(pitch_inp, energy, ret)

ret['decoder_inp'] = decoder_inp = (decoder_inp + spk_embed) * tgt_nonpadding
if 'no_fs2' in hparams.keys() and not hparams['no_fs2']:
if hparams['no_fs2'] if 'no_fs2' in hparams.keys() else True:
if skip_decoder:
return ret
ret['mel_out'] = self.run_decoder(decoder_inp, tgt_nonpadding, ret, infer=infer, **kwargs)
Expand Down

0 comments on commit 88c439a

Please sign in to comment.