infer.sh 3.58 KB
Newer Older
sunzhq2's avatar
sunzhq2 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/bash
# if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# asr_train_config="/home/sunzhq/workspace/yidong-infer/conformer/34e9cabc2c29fd0e3a2917ffa525d98b/exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/config.yaml"
# asr_model_file="/home/sunzhq/workspace/yidong-infer/conformer/34e9cabc2c29fd0e3a2917ffa525d98b/exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/valid.acc.ave_10best.pth"
# lm_train_config=/home/sunzhq/workspace/yidong-infer/conformer/34e9cabc2c29fd0e3a2917ffa525d98b/exp/lm_train_lm_transformer_char_batch_bins2000000/config.yaml
# lm_path=/home/sunzhq/workspace/yidong-infer/conformer/34e9cabc2c29fd0e3a2917ffa525d98b/exp/lm_train_lm_transformer_char_batch_bins2000000/valid.loss.ave_10best.pth
# manifest="/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/test"

asr_train_config="/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/config.yaml"
asr_model_file="/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/valid.acc.ave_10best.pth"
lm_train_config=/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/exp/lm_train_lm_transformer_char_batch_bins2000000/config.yaml
lm_path=/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/exp/lm_train_lm_transformer_char_batch_bins2000000/valid.loss.ave_10best.pth
manifest="/home/sunzhq/workspace/yidong-infer/conformer/torch-infer/test"


mkdir -p logs
# mode='attention_rescoring'
mode='lm_rescoring'
# num_gpus=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
export HIP_VISIBLE_DEVICES=0
nohup numactl -N 0 -m 0 python3 infer.py \
        --config $asr_train_config \
        --model_path $asr_model_file \
        --lm_config $lm_train_config \
        --lm_path $lm_path \
        --gpu 0 \
        --wav_scp $manifest/wav.scp --text $manifest/text \
        --result_file ./logs/predictions_${mode}_$gpu_id.txt \
        --log_file ./logs/log_${mode}_$gpu_id.txt \
        --batch_size 24 --beam_size 10 \
        --mode $mode 2>&1 | tee result_0.log &


export HIP_VISIBLE_DEVICES=1
nohup numactl -N 1 -m 1 python3 infer.py \
        --config $asr_train_config \
        --model_path $asr_model_file \
        --lm_config $lm_train_config \
        --lm_path $lm_path \
        --gpu 0 \
        --wav_scp $manifest/wav.scp --text $manifest/text \
        --result_file ./logs/predictions_${mode}_$gpu_id.txt \
        --log_file ./logs/log_${mode}_$gpu_id.txt \
        --batch_size 24 --beam_size 10 \
        --mode $mode 2>&1 | tee result_1.log &

export HIP_VISIBLE_DEVICES=2
nohup numactl -N 2 -m 2 python3 infer.py \
        --config $asr_train_config \
        --model_path $asr_model_file \
        --lm_config $lm_train_config \
        --lm_path $lm_path \
        --gpu 0 \
        --wav_scp $manifest/wav.scp --text $manifest/text \
        --result_file ./logs/predictions_${mode}_$gpu_id.txt \
        --log_file ./logs/log_${mode}_$gpu_id.txt \
        --batch_size 24 --beam_size 10 \
        --mode $mode 2>&1 | tee result_2.log &

export HIP_VISIBLE_DEVICES=3
nohup numactl -N 3 -m 3 python3 infer.py \
        --config $asr_train_config \
        --model_path $asr_model_file \
        --lm_config $lm_train_config \
        --lm_path $lm_path \
        --gpu 0 \
        --wav_scp $manifest/wav.scp --text $manifest/text \
        --result_file ./logs/predictions_${mode}_$gpu_id.txt \
        --log_file ./logs/log_${mode}_$gpu_id.txt \
        --batch_size 24 --beam_size 10 \
        --mode $mode 2>&1 | tee result_3.log &