From 9c5f00794e7c474d1079ff78e5c69e8c53a30e6e Mon Sep 17 00:00:00 2001 From: dudulu Date: Mon, 5 Feb 2024 10:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dchunk=5Fsize=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=BC=A0=E5=85=A5str=E6=88=96list=E7=BB=93=E6=9E=84?= =?UTF-8?q?=20(#1357)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit h5传入的是list,python 传入的是 str,无论传入是什么类型,强制转成list --- runtime/python/websocket/funasr_wss_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/python/websocket/funasr_wss_server.py b/runtime/python/websocket/funasr_wss_server.py index 513a2f62b..37ca6a98d 100644 --- a/runtime/python/websocket/funasr_wss_server.py +++ b/runtime/python/websocket/funasr_wss_server.py @@ -179,7 +179,9 @@ async def ws_serve(websocket, path): 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"]