From ce4235b1c83752841a8c3506da28f08607b56361 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 19 二月 2024 22:11:49 +0800
Subject: [PATCH] aishell example

---
 examples/aishell/paraformer/run.sh |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/examples/aishell/paraformer/run.sh b/examples/aishell/paraformer/run.sh
index fd51de2..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} \

--
Gitblit v1.9.1