From 24b341a7eb0ad72e021470b8f2d1ee1d0b29ea81 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期日, 23 四月 2023 19:57:10 +0800
Subject: [PATCH] client 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