From fb06c50b11cf4e5e3a55fc62a60f595f2549ff76 Mon Sep 17 00:00:00 2001
From: veelion <veelion@gmail.com>
Date: 星期一, 27 三月 2023 09:01:48 +0800
Subject: [PATCH] add example of grpc client
---
funasr/runtime/python/websocket/ASR_server.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/funasr/runtime/python/websocket/ASR_server.py b/funasr/runtime/python/websocket/ASR_server.py
index 9d0fd0b..1fd02b5 100644
--- a/funasr/runtime/python/websocket/ASR_server.py
+++ b/funasr/runtime/python/websocket/ASR_server.py
@@ -36,7 +36,7 @@
parser.add_argument("--punc_model",
type=str,
- default="damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727",
+ default="",
help="model from modelscope")
parser.add_argument("--ngpu",
type=int,
@@ -70,7 +70,7 @@
param_dict=param_dict_asr,
ngpu=args.ngpu,
)
-if args.punc_model is not None:
+if args.punc_model != "":
param_dict_punc = {'cache': list()}
inference_pipeline_punc = pipeline(
task=Tasks.punctuation,
@@ -128,7 +128,7 @@
rec_result = inference_pipeline_asr(audio_in=audio_in)
if inference_pipeline_punc is not None and 'text' in rec_result:
rec_result = inference_pipeline_punc(text_in=rec_result['text'], param_dict=param_dict_punc)
- print(rec_result["text"])
+ print(rec_result["text"] if "text" in rec_result else rec_result)
time.sleep(0.1)
time.sleep(0.1)
--
Gitblit v1.9.1