Skip to content

Commit

Permalink
Fix loss returned by CTC model in RNNT (#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenaxie authored Jan 26, 2024
1 parent baaa27a commit 0c8945c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wenet/transducer/transducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def forward(
# optional ctc
loss_ctc: Optional[torch.Tensor] = None
if self.ctc_weight != 0.0 and self.ctc is not None:
loss_ctc = self.ctc(encoder_out, encoder_out_lens, text,
text_lengths)
loss_ctc, _ = self.ctc(encoder_out, encoder_out_lens, text,
text_lengths)
else:
loss_ctc = None

Expand Down

0 comments on commit 0c8945c

Please sign in to comment.