From 2f9685797b0c8a420574c2a459c242f90efdf3ee Mon Sep 17 00:00:00 2001
From: aky15 <ankeyuthu@gmail.com>
Date: 星期三, 24 五月 2023 14:04:54 +0800
Subject: [PATCH] support resume model from pai (#544)
---
funasr/runtime/python/websocket/ws_server_2pass.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/funasr/runtime/python/websocket/ws_server_2pass.py b/funasr/runtime/python/websocket/ws_server_2pass.py
index 1d3c135..e5cab9c 100644
--- a/funasr/runtime/python/websocket/ws_server_2pass.py
+++ b/funasr/runtime/python/websocket/ws_server_2pass.py
@@ -170,8 +170,9 @@
rec_result = inference_pipeline_punc(text_in=rec_result['text'],
param_dict=websocket.param_dict_punc)
# print("offline", rec_result)
- message = json.dumps({"mode": "2pass-offline", "text": rec_result["text"], "wav_name": websocket.wav_name})
- await websocket.send(message)
+ if 'text' in rec_result:
+ message = json.dumps({"mode": "2pass-offline", "text": rec_result["text"], "wav_name": websocket.wav_name})
+ await websocket.send(message)
async def async_asr_online(websocket, audio_in):
--
Gitblit v1.9.1