Skip to content

Commit

Permalink
fix issue in zipformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yaozengwei committed Mar 21, 2024
1 parent bddc3fc commit 40888f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion egs/librispeech/ASR/zipformer/zipformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def forward(
selected_attn_weights = attn_weights[0:1]
if torch.jit.is_scripting() or torch.jit.is_tracing():
pass
elif not self.training and random.random() < float(self.const_attention_rate):
elif self.training and random.random() < float(self.const_attention_rate):
# Make attention weights constant. The intention is to
# encourage these modules to do something similar to an
# averaging-over-time operation.
Expand Down

0 comments on commit 40888f6

Please sign in to comment.