Skip to content

Commit 9c5f007

Browse files
authored
修复chunk_size可能传入str或list结构 (#1357)
h5传入的是list,python 传入的是 str,无论传入是什么类型,强制转成list
1 parent 45dc927 commit 9c5f007

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/python/websocket/funasr_wss_server.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ async def ws_serve(websocket, path):
179179
if "wav_name" in messagejson:
180180
websocket.wav_name = messagejson.get("wav_name")
181181
if "chunk_size" in messagejson:
182-
chunk_size = messagejson["chunk_size"].split(',')
182+
chunk_size = messagejson["chunk_size"]
183+
if isinstance(chunk_size, str):
184+
chunk_size = chunk_size.split(',')
183185
websocket.status_dict_asr_online["chunk_size"] = [int(x) for x in chunk_size]
184186
if "encoder_chunk_look_back" in messagejson:
185187
websocket.status_dict_asr_online["encoder_chunk_look_back"] = messagejson["encoder_chunk_look_back"]

0 commit comments

Comments
 (0)