From d615fc33de2f340f1b6ca81c71d08b9bfcdd9b94 Mon Sep 17 00:00:00 2001 From: zxcd <228587199@qq.com> Date: Wed, 14 Aug 2024 14:17:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ASR=E3=80=91fix=20acs=20demo=20(#3826)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix demo acs * fix --- demos/audio_content_search/README.md | 15 ++++++++++++--- demos/audio_content_search/README_cn.md | 18 ++++++++++++++---- .../conf/ws_conformer_application.yaml | 4 +++- .../ws_conformer_wenetspeech_application.yaml | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/demos/audio_content_search/README.md b/demos/audio_content_search/README.md index 4428bf38..f04ac447 100644 --- a/demos/audio_content_search/README.md +++ b/demos/audio_content_search/README.md @@ -19,7 +19,7 @@ You can choose one way from meduim and hard to install paddlespeech. The dependency refers to the requirements.txt, and install the dependency as follows: ``` -pip install -r requriement.txt +pip install -r requirements.txt ``` ### 2. Prepare Input File @@ -30,11 +30,20 @@ Here are sample files for this demo that can be downloaded: wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav ``` -### 3. Usage +### 3. run paddlespeech_server +Before using the client, it is necessary to start paddlespeech_servers. + +Here are sample server configuration: +```bash +bash demos/audio_content_search/run.sh +``` +The logs of the two services will be recorded in 'acs.log' and 'streaming_asr.log' in this configuration. + +### 4. Usage - Command Line(Recommended) ```bash # Chinese - paddlespeech_client acs --server_ip 127.0.0.1 --port 8090 --input ./zh.wav + paddlespeech_client acs --server_ip 127.0.0.1 --port 8490 --input ./zh.wav ``` Usage: diff --git a/demos/audio_content_search/README_cn.md b/demos/audio_content_search/README_cn.md index 6f51c4cf..16c1a3dd 100644 --- a/demos/audio_content_search/README_cn.md +++ b/demos/audio_content_search/README_cn.md @@ -19,7 +19,7 @@ 依赖参见 requirements.txt, 安装依赖 ``` -pip install -r requriement.txt +pip install -r requirements.txt ``` ### 2. 准备输入 @@ -29,16 +29,26 @@ pip install -r requriement.txt ```bash wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav ``` -### 3. 使用方法 + +### 3. 启动 server +使用 client 之前需要先启动 paddlespeech_server。 + +可以使用默认 server 配置: +```bash +bash demos/audio_content_search/run.sh +``` +该配置下两个服务的日志会被记录在 `acs.log` 和 `streaming_asr.log` 中。 + +### 4. 使用方法 - 命令行 (推荐使用) ```bash # 中文 - paddlespeech_client acs --server_ip 127.0.0.1 --port 8090 --input ./zh.wav + paddlespeech_client acs --server_ip 127.0.0.1 --port 8490 --input ./zh.wav ``` 使用方法: ```bash - paddlespeech acs --help + paddlespeech asr --help ``` 参数: - `input`(必须输入):用于识别的音频文件。 diff --git a/demos/audio_content_search/conf/ws_conformer_application.yaml b/demos/audio_content_search/conf/ws_conformer_application.yaml index 97201382..ad34ec9f 100644 --- a/demos/audio_content_search/conf/ws_conformer_application.yaml +++ b/demos/audio_content_search/conf/ws_conformer_application.yaml @@ -26,8 +26,10 @@ asr_online: sample_rate: 16000 cfg_path: decode_method: 'attention_rescoring' + num_decoding_left_chunks: -1 # number of left chunks for decoding. Defaults to -1. force_yes: True device: 'cpu' # cpu or gpu:id + continuous_decoding: False # disable continue decoding when endpoint detected am_predictor_conf: device: # set 'gpu:id' or 'cpu' switch_ir_optim: True @@ -40,4 +42,4 @@ asr_online: window_ms: 25 # ms shift_ms: 10 # ms sample_rate: 16000 - sample_width: 2 + sample_width: 2 \ No newline at end of file diff --git a/demos/audio_content_search/conf/ws_conformer_wenetspeech_application.yaml b/demos/audio_content_search/conf/ws_conformer_wenetspeech_application.yaml index c23680bd..ef1ce8d5 100644 --- a/demos/audio_content_search/conf/ws_conformer_wenetspeech_application.yaml +++ b/demos/audio_content_search/conf/ws_conformer_wenetspeech_application.yaml @@ -31,6 +31,7 @@ asr_online: force_yes: True device: 'cpu' # cpu or gpu:id decode_method: "attention_rescoring" + num_decoding_left_chunks: -1 # number of left chunks for decoding. Defaults to -1. am_predictor_conf: device: # set 'gpu:id' or 'cpu' switch_ir_optim: True