From 6f3005e0632a616e4a7c492d9acf5062bef3bbb0 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 19 二月 2024 22:16:12 +0800
Subject: [PATCH] aishell example
---
examples/aishell/paraformer/run.sh | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/examples/aishell/paraformer/run.sh b/examples/aishell/paraformer/run.sh
index 149f4d7..9945132 100755
--- a/examples/aishell/paraformer/run.sh
+++ b/examples/aishell/paraformer/run.sh
@@ -1,13 +1,8 @@
#!/usr/bin/env bash
-workspace=`pwd`
-# machines configuration
+
CUDA_VISIBLE_DEVICES="0,1"
-gpu_num=2
-gpu_inference=true # Whether to perform gpu decoding, set false for cpu decoding
-# for gpu decoding, inference_nj=ngpu*njob; for cpu decoding, inference_nj=njob
-njob=1
# general configuration
feats_dir="../DATA" #feature output dictionary
@@ -18,7 +13,11 @@
stop_stage=5
# feature configuration
-nj=64
+nj=32
+
+inference_device="cuda" #"cpu"
+inference_checkpoint="model.pt"
+inference_scp="wav.scp"
# data
raw_data=../raw_data
@@ -26,6 +25,7 @@
# exp tag
tag="exp1"
+workspace=`pwd`
. utils/parse_options.sh || exit 1;
@@ -41,11 +41,6 @@
config=train_asr_paraformer_conformer_12e_6d_2048_256.yaml
model_dir="baseline_$(basename "${config}" .yaml)_${lang}_${token_type}_${tag}"
-
-inference_device="cuda" #"cpu"
-inference_checkpoint="model.pt"
-inference_scp="wav.scp"
-
if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then
@@ -112,6 +107,8 @@
mkdir -p ${exp_dir}/exp/${model_dir}
log_file="${exp_dir}/exp/${model_dir}/train.log.txt"
echo "log_file: ${log_file}"
+
+ gpu_num=$(echo CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
torchrun \
--nnodes 1 \
--nproc_per_node ${gpu_num} \
@@ -119,6 +116,7 @@
--config-path "${workspace}/conf" \
--config-name "${config}" \
++train_data_set_list="${feats_dir}/data/${train_set}/audio_datasets.jsonl" \
+ ++valid_data_set_list="${feats_dir}/data/${valid_set}/audio_datasets.jsonl" \
++tokenizer_conf.token_list="${token_list}" \
++frontend_conf.cmvn_file="${feats_dir}/data/${train_set}/am.mvn" \
++output_dir="${exp_dir}/exp/${model_dir}" &> ${log_file}
--
Gitblit v1.9.1