Update asr_inference_paraformer_streaming.py

This commit is contained in:
hnluo 2023-04-27 01:15:59 +08:00 committed by GitHub
parent 7584bbd6f3
commit 6abf68388c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,9 +202,9 @@ class Speech2Text:
assert check_argument_types()
results = []
cache_en = cache["encoder"]
if speech.shape[1] < 16 * 60 and cache["is_final"]:
cache["last_chunk"] = True
feats = cache["feats"]
if speech.shape[1] < 16 * 60 and cache_en["is_final"]:
cache_en["last_chunk"] = True
feats = cache_en["feats"]
feats_len = torch.tensor([feats.shape[1]])
else:
if self.frontend is not None: