From 4f498e8d82ae5e7e977326a24f897c4b9fdc46bb Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期六, 06 五月 2023 22:24:50 +0800
Subject: [PATCH] websocket
---
funasr/runtime/python/websocket/ws_client.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/funasr/runtime/python/websocket/ws_client.py b/funasr/runtime/python/websocket/ws_client.py
index 55507a7..d32ce0a 100644
--- a/funasr/runtime/python/websocket/ws_client.py
+++ b/funasr/runtime/python/websocket/ws_client.py
@@ -36,6 +36,10 @@
type=int,
default=1,
help="test_thread_num")
+parser.add_argument("--words_max_print",
+ type=int,
+ default=100,
+ help="chunk")
args = parser.parse_args()
args.chunk_size = [int(x) for x in args.chunk_size.split(",")]
@@ -151,9 +155,8 @@
meg = json.loads(meg)
# print(meg, end = '')
# print("\r")
- text = meg["text"]
- text_print += text
- text_print = text_print[-55:]
+ text_print += " {}".format(meg["text"][0])
+ text_print = text_print[-args.words_max_print:]
#os.system('clear')
print("\r"+str(id)+":"+text_print)
except Exception as e:
--
Gitblit v1.9.1