forked from PaddlePaddle/Research
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpredict.sh
More file actions
executable file
·35 lines (27 loc) · 934 Bytes
/
predict.sh
File metadata and controls
executable file
·35 lines (27 loc) · 934 Bytes
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
#!/bin/bash
export PYTHONIOENCODING=utf-8
if [ -z "$CUDA_VISIBLE_DEVICES" ];then
export CUDA_VISIBLE_DEVICES=0
fi
echo "CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
if [ -z "$PRETRAINED_MODEL_PATH" ];then
PRETRAINED_MODEL_PATH="./pretrained_model"
fi
echo "PRETRAINED_MODEL_PATH=$PRETRAINED_MODEL_PATH"
if [ -z "$CKPT" ];then
CKPT="./finetuned_model"
fi
echo "CKPT=$CKPT"
python -u src/run_mrc.py --use_cuda true \
--batch_size 24 \
--checkpoints output \
--init_checkpoint ${CKPT} \
--vocab_path ${PRETRAINED_MODEL_PATH}/vocab.txt \
--ernie_config ${PRETRAINED_MODEL_PATH}/ernie_config.json \
--max_seq_len 512 \
--do_lower_case true \
--doc_stride 128 \
--max_answer_length 30 \
--do_train false \
--do_predict true \
$@