From 33d3d2084403fd34b79c835d2f2fe04f6cd8f738 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期三, 13 九月 2023 09:33:54 +0800
Subject: [PATCH] Merge branch 'main' of github.com:alibaba-damo-academy/FunASR add
---
funasr/models/e2e_asr_transducer.py | 27 ++-------------------------
1 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/funasr/models/e2e_asr_transducer.py b/funasr/models/e2e_asr_transducer.py
index 80914b1..bffd54d 100644
--- a/funasr/models/e2e_asr_transducer.py
+++ b/funasr/models/e2e_asr_transducer.py
@@ -353,11 +353,6 @@
"""
if self.criterion_transducer is None:
try:
- # from warprnnt_pytorch import RNNTLoss
- # self.criterion_transducer = RNNTLoss(
- # reduction="mean",
- # fastemit_lambda=self.fastemit_lambda,
- # )
from warp_rnnt import rnnt_loss as RNNTLoss
self.criterion_transducer = RNNTLoss
@@ -368,12 +363,6 @@
)
exit(1)
- # loss_transducer = self.criterion_transducer(
- # joint_out,
- # target,
- # t_len,
- # u_len,
- # )
log_probs = torch.log_softmax(joint_out, dim=-1)
loss_transducer = self.criterion_transducer(
@@ -637,7 +626,6 @@
batch_size = speech.shape[0]
text = text[:, : text_lengths.max()]
- #print(speech.shape)
# 1. Encoder
encoder_out, encoder_out_chunk, encoder_out_lens = self.encode(speech, speech_lengths)
@@ -709,7 +697,7 @@
loss_trans = loss_trans_utt + loss_trans_chunk
loss_ctc = loss_ctc + loss_ctc_chunk
- loss_ctc = loss_att + loss_att_chunk
+ loss_att = loss_att + loss_att_chunk
loss = (
self.transducer_weight * loss_trans
@@ -854,11 +842,6 @@
"""
if self.criterion_transducer is None:
try:
- # from warprnnt_pytorch import RNNTLoss
- # self.criterion_transducer = RNNTLoss(
- # reduction="mean",
- # fastemit_lambda=self.fastemit_lambda,
- # )
from warp_rnnt import rnnt_loss as RNNTLoss
self.criterion_transducer = RNNTLoss
@@ -869,12 +852,6 @@
)
exit(1)
- # loss_transducer = self.criterion_transducer(
- # joint_out,
- # target,
- # t_len,
- # u_len,
- # )
log_probs = torch.log_softmax(joint_out, dim=-1)
loss_transducer = self.criterion_transducer(
@@ -1013,4 +990,4 @@
ignore_label=self.ignore_id,
)
- return loss_att, acc_att
\ No newline at end of file
+ return loss_att, acc_att
--
Gitblit v1.9.1