From dbbe718fc965fa80e67976d629b720dc1a8f1525 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 18 三月 2024 22:24:37 +0800
Subject: [PATCH] Merge branch 'main' of github.com:alibaba-damo-academy/FunASR merge

---
 funasr/models/paraformer_streaming/model.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/funasr/models/paraformer_streaming/model.py b/funasr/models/paraformer_streaming/model.py
index 4cf20de..5daa73a 100644
--- a/funasr/models/paraformer_streaming/model.py
+++ b/funasr/models/paraformer_streaming/model.py
@@ -531,6 +531,8 @@
         for i in range(n):
             kwargs["is_final"] = _is_final and i == n -1
             audio_sample_i = audio_sample[i*chunk_stride_samples:(i+1)*chunk_stride_samples]
+            if kwargs["is_final"] and len(audio_sample_i) < 960:
+                continue
 
             # extract fbank feats
             speech, speech_lengths = extract_fbank([audio_sample_i], data_type=kwargs.get("data_type", "sound"),
@@ -560,5 +562,8 @@
             ibest_writer["text"][key[0]] = text_postprocessed
 
         return result, meta_data
-
-
+    
+    def export(self, **kwargs):
+        from .export_meta import export_rebuild_model
+        models = export_rebuild_model(model=self, **kwargs)
+        return models
\ No newline at end of file

--
Gitblit v1.9.1