From 4d907718f39e2b0f7a0c714c2e3de289e742fc61 Mon Sep 17 00:00:00 2001
From: Carl <415692979@qq.com>
Date: 星期四, 28 三月 2024 13:42:00 +0800
Subject: [PATCH] 修正commit 87b62d68957a2194b017a43b6c2a15424a05a984 引入的英文整句标点预测导致末尾两个单词中间的空格被删除的问题。 (#1556)
---
runtime/python/websocket/funasr_wss_server.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/runtime/python/websocket/funasr_wss_server.py b/runtime/python/websocket/funasr_wss_server.py
index 7db7b0a..015d87b 100644
--- a/runtime/python/websocket/funasr_wss_server.py
+++ b/runtime/python/websocket/funasr_wss_server.py
@@ -152,7 +152,7 @@
frames_asr = []
frames_asr_online = []
global websocket_users
- await clear_websocket()
+ # await clear_websocket()
websocket_users.add(websocket)
websocket.status_dict_asr = {}
websocket.status_dict_asr_online = {"cache": {}, "is_final": False}
@@ -179,7 +179,10 @@
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"]
+ 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"]
if "decoder_chunk_look_back" in messagejson:
--
Gitblit v1.9.1