From c494d8fd18c29f601829f428a327b09ac7c29aed Mon Sep 17 00:00:00 2001
From: locasxe <71017860+locasxe@users.noreply.github.com>
Date: 星期三, 25 九月 2024 23:25:18 +0800
Subject: [PATCH] fix onnxruntime memoryleak when load model (#2108)
---
runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py b/runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py
index 41f9042..37c98a8 100644
--- a/runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py
+++ b/runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py
@@ -165,6 +165,9 @@
feats, feats_len = self.extract_feat(waveform_list[beg_idx:end_idx])
_language_list = language_list[beg_idx:end_idx]
_textnorm_list = textnorm_list[beg_idx:end_idx]
+ if not len(_language_list):
+ _language_list = [language_list[0]]
+ _textnorm_list = [textnorm_list[0]]
B = feats.shape[0]
if len(_language_list) == 1 and B != 1:
_language_list = _language_list * B
--
Gitblit v1.9.1