-
Notifications
You must be signed in to change notification settings - Fork 13
/
inference.sh
32 lines (27 loc) · 1.02 KB
/
inference.sh
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
#!/bin/bash
# set your path
HOME_ROOT=/root/MooER
cd $HOME_ROOT || exit 0
test_data_dir=YOUR/testsets/root
test_sets=test-clean/test-other/aishell
decode_path=YOUR/decode/dir
export PYTHONPATH=${HOME_ROOT}/src:$PYTHONPATH
VISIBLE_DEVICES=0
################### For MUSA User #############################
# export MUSA_VISIBLE_DEVICES=$VISIBLE_DEVICES
# export DS_ACCELERATOR=musa
###############################################################
# For CUDA User
export CUDA_VISIBLE_DEVICES=$VISIBLE_DEVICES
###############################################################
python ${HOME_ROOT}/src/mooer/testing.py \
--test_config ${HOME_ROOT}/src/mooer/configs/asr_config_inference.py \
--test_data_dir $test_data_dir \
--test_sets $test_sets \
--decode_path $decode_path
# compute CER
for testset in `echo $test_sets | sed "s|/| |g"`; do
echo $testset
python ${HOME_ROOT}/src/tools/compute-wer.py --char=1 --v=1 ${test_data_dir}/${testset}/text \
${decode_path}/${testset}/text > ${decode_path}/${testset}/wer 2>&1
done