From 580b11b57ac4b62f7e2acda73813a4e10e8e4cd3 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 10 十月 2023 17:17:29 +0800
Subject: [PATCH] v0.8.0
---
funasr/bin/asr_infer.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/funasr/bin/asr_infer.py b/funasr/bin/asr_infer.py
index 7746821..3117e5d 100644
--- a/funasr/bin/asr_infer.py
+++ b/funasr/bin/asr_infer.py
@@ -430,7 +430,7 @@
# b. Forward Encoder
if decoding_ind is None:
- decoding_ind = self.decoding_ind
+ decoding_ind = 0 if self.decoding_ind is None else self.decoding_ind
enc, enc_len = self.asr_model.encode(**batch, ind=decoding_ind)
if isinstance(enc, tuple):
enc = enc[0]
@@ -1337,7 +1337,7 @@
quantize_dtype: str = "qint8",
nbest: int = 1,
streaming: bool = False,
- simu_streaming: bool = False,
+ fake_streaming: bool = False,
full_utt: bool = False,
chunk_size: int = 16,
left_context: int = 32,
@@ -1432,7 +1432,7 @@
self.beam_search = beam_search
self.streaming = streaming
- self.simu_streaming = simu_streaming
+ self.fake_streaming = fake_streaming
self.full_utt = full_utt
self.chunk_size = max(chunk_size, 0)
self.left_context = left_context
@@ -1442,8 +1442,8 @@
self.streaming = False
self.asr_model.encoder.dynamic_chunk_training = False
- if not simu_streaming or chunk_size == 0:
- self.simu_streaming = False
+ if not fake_streaming or chunk_size == 0:
+ self.fake_streaming = False
self.asr_model.encoder.dynamic_chunk_training = False
self.frontend = frontend
@@ -1520,7 +1520,7 @@
return nbest_hyps
@torch.no_grad()
- def simu_streaming_decode(self, speech: Union[torch.Tensor, np.ndarray]) -> List[HypothesisTransducer]:
+ def fake_streaming_decode(self, speech: Union[torch.Tensor, np.ndarray]) -> List[HypothesisTransducer]:
"""Speech2Text call.
Args:
speech: Speech data. (S)
--
Gitblit v1.9.1