Skip to content

Commit

Permalink
修复chunk_size可能传入str或list结构 (#1357)
Browse files Browse the repository at this point in the history
h5传入的是list,python 传入的是 str,无论传入是什么类型,强制转成list
  • Loading branch information
icowan authored Feb 5, 2024
1 parent 45dc927 commit 9c5f007
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/python/websocket/funasr_wss_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 9c5f007

Please sign in to comment.