From 033ef80e4e721cd980bf3e0c4f0c112bab2dd603 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 24 四月 2023 11:17:24 +0800
Subject: [PATCH] Merge pull request #405 from alibaba-damo-academy/dev_aky
---
funasr/modules/nets_utils.py | 2 +-
funasr/bin/asr_inference_rnnt.py | 2 +-
funasr/models/e2e_asr_transducer.py | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/funasr/bin/asr_inference_rnnt.py b/funasr/bin/asr_inference_rnnt.py
index bff8702..d964643 100644
--- a/funasr/bin/asr_inference_rnnt.py
+++ b/funasr/bin/asr_inference_rnnt.py
@@ -174,7 +174,7 @@
self.streaming = streaming
self.simu_streaming = simu_streaming
self.chunk_size = max(chunk_size, 0)
- self.left_context = max(left_context, 0)
+ self.left_context = left_context
self.right_context = max(right_context, 0)
if not streaming or chunk_size == 0:
diff --git a/funasr/models/e2e_asr_transducer.py b/funasr/models/e2e_asr_transducer.py
index 0cae306..657dd75 100644
--- a/funasr/models/e2e_asr_transducer.py
+++ b/funasr/models/e2e_asr_transducer.py
@@ -531,8 +531,8 @@
sym_blank: str = "<blank>",
report_cer: bool = True,
report_wer: bool = True,
- sym_sos: str = "<sos/eos>",
- sym_eos: str = "<sos/eos>",
+ sym_sos: str = "<s>",
+ sym_eos: str = "</s>",
extract_feats_in_collect_stats: bool = True,
lsm_weight: float = 0.0,
length_normalized_loss: bool = False,
diff --git a/funasr/modules/nets_utils.py b/funasr/modules/nets_utils.py
index 5d4fe1c..10df124 100644
--- a/funasr/modules/nets_utils.py
+++ b/funasr/modules/nets_utils.py
@@ -595,7 +595,7 @@
mask = torch.zeros(size, size, device=device, dtype=torch.bool)
for i in range(size):
- if left_chunk_size <= 0:
+ if left_chunk_size < 0:
start = 0
else:
start = max((i // chunk_size - left_chunk_size) * chunk_size, 0)
--
Gitblit v1.9.1