test.sh 589 字节
Newer Older
1
#!/bin/bash
2

3 4
if [ $# != 3 ];then
    echo "usage: ${0} config_path ckpt_path_prefix model_type"
5 6 7 8 9 10 11 12
    exit -1
fi

ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
echo "using $ngpu gpus..."

config_path=$1
ckpt_prefix=$2
13
model_type=$3
14 15

# download language model
H
huangyuxin 已提交
16
bash local/download_lm_ch.sh
17 18 19 20 21
if [ $? -ne 0 ]; then
   exit 1
fi

python3 -u ${BIN_DIR}/test.py \
H
Hui Zhang 已提交
22
--nproc ${ngpu} \
23 24
--config ${config_path} \
--result_file ${ckpt_prefix}.rsl \
25 26
--checkpoint_path ${ckpt_prefix} \
--model_type ${model_type}
27 28 29 30 31 32 33 34

if [ $? -ne 0 ]; then
    echo "Failed in evaluation!"
    exit 1
fi


exit 0