FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

python 版本的runtime使用websocket进行测试,长时间运行时会出现客户端无法向服务端发送消息的问题

Open Huanyongji opened this issue 1 year ago • 1 comments

🐛 Bug

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. in one terminal: 2.cmd 'cd xxxx/FunASR/runtime/python/websocket' and cmd 'python3 funasr_wss_server.py'
  2. in another terminal:
  3. cmd 'cd xxxx/FunASR/runtime/python/websocket' and cmd 'python3 funasr_wss_client.py'
  4. after a long time(Maybe 1 hour),funasr_wss_client.py can not sen msg to server,

Code sample

#voices.put(message) await websocket.send(message) #data = stream.read(CHUNK) while True: print('------------- 1 -----------------\n') data = stream.read(CHUNK) message = data print('------------- 2 -----------------\n') #voices.put(message) await websocket.send(message) # this line cause ERROR!!! print('------------- 3 -----------------\n') await asyncio.sleep(0) meg = await websocket.recv() print(meg)

Expected behavior

Environment

  • OS (e.g., Linux):
  • FunASR Version (e.g., 1.0.0):
  • ModelScope Version (e.g.,v2.0.4 ):
  • PyTorch Version (e.g., 1.12.0):
  • How you installed funasr ( source):
  • Python version:
  • GPU (e.g., RTX3090)
  • CUDA/cuDNN version (e.g., cuda11.8):
  • Any other relevant information:

Additional context

Huanyongji avatar Feb 01 '24 07:02 Huanyongji