From 63bcaf7093c986e0c33b14212fca3705c0877864 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 31 三月 2023 17:28:00 +0800
Subject: [PATCH] export

---
 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