From a917d7557dd2b1e5263eeba7e5e4d5a5fc02f69f Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 27 四月 2023 11:41:16 +0800
Subject: [PATCH] websocket
---
funasr/runtime/python/websocket/ASR_server.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/funasr/runtime/python/websocket/ASR_server.py b/funasr/runtime/python/websocket/ASR_server.py
index 827df7b..c717e71 100644
--- a/funasr/runtime/python/websocket/ASR_server.py
+++ b/funasr/runtime/python/websocket/ASR_server.py
@@ -4,6 +4,7 @@
from queue import Queue
import threading
import argparse
+import json
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
@@ -157,7 +158,8 @@
rec_result = inference_pipeline_punc(text_in=rec_result['text'], param_dict=websocket.param_dict_punc)
# print(rec_result)
if "text" in rec_result:
- websocket.send_msg.put(rec_result["text"]) # 瀛樺叆鍙戦�侀槦鍒� 鐩存帴璋冪敤send鍙戦�佷笉浜�
+ message = json.dumps({"mode": "offline", "text": rec_result["text"]})
+ websocket.send_msg.put(message) # 瀛樺叆鍙戦�侀槦鍒� 鐩存帴璋冪敤send鍙戦�佷笉浜�
time.sleep(0.1)
--
Gitblit v1.9.1