From 2978c59a95c3c71df8e26385294877917160f2c7 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 08 五月 2023 11:25:38 +0800
Subject: [PATCH] websocket python

---
 funasr/version.txt                                   |    2 +-
 funasr/runtime/python/websocket/ws_server_offline.py |    4 ++--
 funasr/runtime/python/websocket/ws_client.py         |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/funasr/runtime/python/websocket/ws_client.py b/funasr/runtime/python/websocket/ws_client.py
index bbc49b1..9de31a4 100644
--- a/funasr/runtime/python/websocket/ws_client.py
+++ b/funasr/runtime/python/websocket/ws_client.py
@@ -167,7 +167,7 @@
             # print(meg)
             wav_name = meg.get("wav_name", "demo")
             print(wav_name)
-            text = meg["text"][0]
+            text = meg["text"]
             if ibest_writer is not None:
                 ibest_writer["text"][wav_name] = text
             if meg["mode"] == "online":
diff --git a/funasr/runtime/python/websocket/ws_server_offline.py b/funasr/runtime/python/websocket/ws_server_offline.py
index c415703..15578f6 100644
--- a/funasr/runtime/python/websocket/ws_server_offline.py
+++ b/funasr/runtime/python/websocket/ws_server_offline.py
@@ -138,10 +138,10 @@
                     rec_result = inference_pipeline_punc(text_in=rec_result['text'],
                                                          param_dict=websocket.param_dict_punc)
                     # print(rec_result)
-                message = json.dumps({"mode": "offline", "text": [rec_result["text"]], "wav_name": websocket.wav_name})
+                message = json.dumps({"mode": "offline", "text": rec_result["text"], "wav_name": websocket.wav_name})
                 await websocket.send(message)
                 
-                    
+                
  
 
 
diff --git a/funasr/version.txt b/funasr/version.txt
index ef52a64..f905682 100644
--- a/funasr/version.txt
+++ b/funasr/version.txt
@@ -1 +1 @@
-0.4.6
+0.4.7

--
Gitblit v1.9.1