Просмотр исходного кода

Update funasr_wss_server.py (#1322)

解决报

```python
return await cast(
  File "funasr_wss_server.py", line 188, in ws_serve
    int(websocket.status_dict_asr_online["chunk_size"][1]) * 60 / websocket.chunk_interval)
ValueError: invalid literal for int() with base 10: ','
^CTraceback (most recent call last):
  File "funasr_wss_server.py", line 302, in <module>
    asyncio.get_event_loop().run_forever()
```
dudulu 2 лет назад
Родитель
Сommit
6cdbcf4b0a
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      runtime/python/websocket/funasr_wss_server.py

+ 2 - 1
runtime/python/websocket/funasr_wss_server.py

@@ -179,7 +179,8 @@ async def ws_serve(websocket, path):
 				if "wav_name" in messagejson:
 					websocket.wav_name = messagejson.get("wav_name")
 				if "chunk_size" in messagejson:
-					websocket.status_dict_asr_online["chunk_size"] = messagejson["chunk_size"]
+					chunk_size = messagejson["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"]
 				if "decoder_chunk_look_back" in messagejson: