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

H
huangyuxin 已提交
3
if [ $# != 3 ];then
H
huangyuxin 已提交
4
    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
H
huangyuxin 已提交
13
model_type=$3
14 15

# download language model
16
bash local/download_lm_en.sh > /dev/null 2>&1
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 \
H
huangyuxin 已提交
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