From 5656768c9508894965ccfde4e6374b0a8d6364be Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 10 May 2022 10:10:04 +0800 Subject: [PATCH 1/2] streaming asr server using paddlespeech_server/client --- demos/streaming_asr_server/server.sh | 7 +++++-- demos/streaming_asr_server/test.sh | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/demos/streaming_asr_server/server.sh b/demos/streaming_asr_server/server.sh index 04858321..4266f8c6 100755 --- a/demos/streaming_asr_server/server.sh +++ b/demos/streaming_asr_server/server.sh @@ -1,5 +1,8 @@ export CUDA_VISIBLE_DEVICE=0,1,2,3 + export CUDA_VISIBLE_DEVICE=0,1,2,3 -nohup python3 punc_server.py --config_file conf/punc_application.yaml > punc.log 2>&1 & +# nohup python3 punc_server.py --config_file conf/punc_application.yaml > punc.log 2>&1 & +paddlespeech_server start --config_file conf/punc_application.yaml &> punc.log & -nohup python3 streaming_asr_server.py --config_file conf/ws_conformer_application.yaml > streaming_asr.log 2>&1 & +# nohup python3 streaming_asr_server.py --config_file conf/ws_conformer_application.yaml > streaming_asr.log 2>&1 & +paddlespeech_server start --config_file conf/ws_conformer_application.yaml &> streaming_asr.log & \ No newline at end of file diff --git a/demos/streaming_asr_server/test.sh b/demos/streaming_asr_server/test.sh index 912d67a2..c7b57e9b 100755 --- a/demos/streaming_asr_server/test.sh +++ b/demos/streaming_asr_server/test.sh @@ -2,7 +2,9 @@ wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav # read the wav and pass it to only streaming asr service -python3 websocket_client.py --server_ip 127.0.0.1 --port 8290 --wavfile ./zh.wav +# python3 websocket_client.py --server_ip 127.0.0.1 --port 8290 --wavfile ./zh.wav +paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8290 --input ./zh.wav # read the wav and call streaming and punc service -python3 websocket_client.py --server_ip 127.0.0.1 --port 8290 --punc.server_ip 127.0.0.1 --punc.port 8190 --wavfile ./zh.wav +# python3 websocket_client.py --server_ip 127.0.0.1 --port 8290 --punc.server_ip 127.0.0.1 --punc.port 8190 --wavfile ./zh.wav +paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8290 --punc.server_ip 127.0.0.1 --punc.port 8190 --input ./zh.wav \ No newline at end of file From 1eab2b86983a942733f07e1752f226bb8f0d6ee3 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 10 May 2022 10:19:21 +0800 Subject: [PATCH 2/2] update asr port --- demos/streaming_asr_server/conf/application.yaml | 4 ++-- demos/streaming_asr_server/conf/ws_application.yaml | 1 + demos/streaming_asr_server/conf/ws_conformer_application.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/demos/streaming_asr_server/conf/application.yaml b/demos/streaming_asr_server/conf/application.yaml index 50c7a727..f576d704 100644 --- a/demos/streaming_asr_server/conf/application.yaml +++ b/demos/streaming_asr_server/conf/application.yaml @@ -21,7 +21,7 @@ engine_list: ['asr_online'] ################################### ASR ######################################### ################### speech task: asr; engine_type: online ####################### asr_online: - model_type: 'conformer_online_multicn' + model_type: 'conformer_online_wenetspeech' am_model: # the pdmodel file of am static model [optional] am_params: # the pdiparams file of am static model [optional] lang: 'zh' @@ -29,7 +29,7 @@ asr_online: cfg_path: decode_method: force_yes: True - device: # cpu or gpu:id + device: cpu # cpu or gpu:id am_predictor_conf: device: # set 'gpu:id' or 'cpu' switch_ir_optim: True diff --git a/demos/streaming_asr_server/conf/ws_application.yaml b/demos/streaming_asr_server/conf/ws_application.yaml index fc02f2ca..f2ea6330 100644 --- a/demos/streaming_asr_server/conf/ws_application.yaml +++ b/demos/streaming_asr_server/conf/ws_application.yaml @@ -29,6 +29,7 @@ asr_online: cfg_path: decode_method: force_yes: True + device: 'cpu' # cpu or gpu:id am_predictor_conf: device: # set 'gpu:id' or 'cpu' diff --git a/demos/streaming_asr_server/conf/ws_conformer_application.yaml b/demos/streaming_asr_server/conf/ws_conformer_application.yaml index 20a50008..2affde07 100644 --- a/demos/streaming_asr_server/conf/ws_conformer_application.yaml +++ b/demos/streaming_asr_server/conf/ws_conformer_application.yaml @@ -4,7 +4,7 @@ # SERVER SETTING # ################################################################################# host: 0.0.0.0 -port: 8290 +port: 8090 # The task format in the engin_list is: _ # task choices = ['asr_online']