From 8a8d60d5786510ec7b1dd4f622e848de8a15f8a8 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期一, 15 一月 2024 16:36:51 +0800
Subject: [PATCH] replace NULL for onnxruntime/src

---
 examples/industrial_data_pretraining/paraformer_streaming/demo.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/industrial_data_pretraining/paraformer_streaming/demo.py b/examples/industrial_data_pretraining/paraformer_streaming/demo.py
index d4dd34e..8f7eef3 100644
--- a/examples/industrial_data_pretraining/paraformer_streaming/demo.py
+++ b/examples/industrial_data_pretraining/paraformer_streaming/demo.py
@@ -9,7 +9,7 @@
 encoder_chunk_look_back = 4 #number of chunks to lookback for encoder self-attention
 decoder_chunk_look_back = 1 #number of encoder chunks to lookback for decoder cross-attention
 
-model = AutoModel(model="damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online", model_revision="v2.0.0")
+model = AutoModel(model="damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online", model_revision="v2.0.2")
 cache = {}
 res = model(input="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav",
             chunk_size=chunk_size,
@@ -28,10 +28,10 @@
 chunk_stride = chunk_size[1] * 960 # 600ms銆�480ms
 
 cache = {}
-
-for i in range(int(len((speech)-1)/chunk_stride+1)):
+total_chunk_num = int(len((speech)-1)/chunk_stride+1)
+for i in range(total_chunk_num):
     speech_chunk = speech[i*chunk_stride:(i+1)*chunk_stride]
-    is_final = i == int(len((speech)-1)/chunk_stride+1)
+    is_final = i == total_chunk_num - 1
     res = model(input=speech_chunk,
                 cache=cache,
                 is_final=is_final,

--
Gitblit v1.9.1