From 9c5f00794e7c474d1079ff78e5c69e8c53a30e6e Mon Sep 17 00:00:00 2001
From: dudulu <solacowa@gmail.com>
Date: 星期一, 05 二月 2024 10:10:52 +0800
Subject: [PATCH] 修复chunk_size可能传入str或list结构 (#1357)

---
 runtime/python/websocket/funasr_wss_server.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/runtime/python/websocket/funasr_wss_server.py b/runtime/python/websocket/funasr_wss_server.py
index 513a2f6..37ca6a9 100644
--- a/runtime/python/websocket/funasr_wss_server.py
+++ b/runtime/python/websocket/funasr_wss_server.py
@@ -179,7 +179,9 @@
 				if "wav_name" in messagejson:
 					websocket.wav_name = messagejson.get("wav_name")
 				if "chunk_size" in messagejson:
-					chunk_size = messagejson["chunk_size"].split(',')
+					chunk_size = messagejson["chunk_size"]
+			                if isinstance(chunk_size, str):
+			                    chunk_size = chunk_size.split(',')
 					websocket.status_dict_asr_online["chunk_size"] = [int(x) for x in chunk_size]
 				if "encoder_chunk_look_back" in messagejson:
 					websocket.status_dict_asr_online["encoder_chunk_look_back"] = messagejson["encoder_chunk_look_back"]

--
Gitblit v1.9.1