From 978201de8e822fe77fade69865ca526a5592fa89 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 17 一月 2023 17:37:18 +0800
Subject: [PATCH] Merge pull request #36 from alibaba-damo-academy/dev

---
 funasr/bin/asr_inference_paraformer.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/funasr/bin/asr_inference_paraformer.py b/funasr/bin/asr_inference_paraformer.py
index 1a73457..c1f0864 100644
--- a/funasr/bin/asr_inference_paraformer.py
+++ b/funasr/bin/asr_inference_paraformer.py
@@ -259,7 +259,7 @@
                     token_int = hyp.yseq[1:last_pos].tolist()
 
                 # remove blank symbol id, which is assumed to be 0
-                token_int = list(filter(lambda x: x != 0, token_int))
+                token_int = list(filter(lambda x: x != 0 and x != 2, token_int))
 
                 # Change integer-ids to tokens
                 token = self.converter.ids2tokens(token_int)
@@ -650,7 +650,7 @@
                         finish_count += 1
                         # asr_utils.print_progress(finish_count / file_count)
                         if writer is not None:
-                            ibest_writer["text"][key] = text
+                            ibest_writer["text"][key] = text_postprocessed
 
                     logging.info("decoding, utt: {}, predictions: {}".format(key, text))
         rtf_avg = "decoding, feature length total: {}, forward_time total: {:.4f}, rtf avg: {:.4f}".format(length_total, forward_time_total, 100 * forward_time_total / (length_total * lfr_factor))

--
Gitblit v1.9.1