From 28ccfbfc51068a663a80764e14074df5edf2b5ba Mon Sep 17 00:00:00 2001
From: kongdeqiang <kongdeqiang960204@163.com>
Date: 星期五, 13 三月 2026 17:41:41 +0800
Subject: [PATCH] 提交

---
 runtime/python/onnxruntime/demo_vad_online.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/runtime/python/onnxruntime/demo_vad_online.py b/runtime/python/onnxruntime/demo_vad_online.py
index a80f58a..b3e580b 100644
--- a/runtime/python/onnxruntime/demo_vad_online.py
+++ b/runtime/python/onnxruntime/demo_vad_online.py
@@ -3,7 +3,9 @@
 from pathlib import Path
 
 model_dir = "damo/speech_fsmn_vad_zh-cn-16k-common-pytorch"
-wav_path = '{}/.cache/modelscope/hub/damo/speech_fsmn_vad_zh-cn-16k-common-pytorch/example/vad_example.wav'.format(Path.home())
+wav_path = "{}/.cache/modelscope/hub/damo/speech_fsmn_vad_zh-cn-16k-common-pytorch/example/vad_example.wav".format(
+    Path.home()
+)
 
 model = Fsmn_vad_online(model_dir)
 
@@ -14,15 +16,16 @@
 #
 sample_offset = 0
 step = 1600
-param_dict = {'in_cache': []}
+param_dict = {"in_cache": []}
 for sample_offset in range(0, speech_length, min(step, speech_length - sample_offset)):
     if sample_offset + step >= speech_length - 1:
         step = speech_length - sample_offset
         is_final = True
     else:
         is_final = False
-    param_dict['is_final'] = is_final
-    segments_result = model(audio_in=speech[sample_offset: sample_offset + step],
-                            param_dict=param_dict)
+    param_dict["is_final"] = is_final
+    segments_result = model(
+        audio_in=speech[sample_offset : sample_offset + step], param_dict=param_dict
+    )
     if segments_result:
-        print(segments_result)
\ No newline at end of file
+        print(segments_result)

--
Gitblit v1.9.1