-
Notifications
You must be signed in to change notification settings - Fork 36
/
run_eval.bash
executable file
·53 lines (50 loc) · 1.09 KB
/
run_eval.bash
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
export device="0"
export model_path=""
export data_name=data/text2tree/one_ie_ace2005_subtype
export task_name="event"
export batch=1
export decoding_format='tree'
while getopts "b:d:m:i:t:co:f:" arg; do
case $arg in
b)
batch=$OPTARG
;;
d)
device=$OPTARG
;;
m)
model_path=$OPTARG
;;
i)
data_folder=$OPTARG
;;
t)
task_name=$OPTARG
;;
f)
decoding_format=$OPTARG
;;
c)
constraint_decoding="--constraint_decoding"
;;
o)
extra_cmd=$OPTARG
;;
?)
echo "unkonw argument"
exit 1
;;
esac
done
echo "Extra CMD: " "${extra_cmd}"
CUDA_VISIBLE_DEVICES=${device} python run_seq2seq.py \
--do_eval --do_predict --task=${task_name} --predict_with_generate \
--validation_file=${data_folder}/val.json \
--test_file=${data_folder}/test.json \
--event_schema=${data_folder}/event.schema \
--model_name_or_path=${model_path} \
--output_dir="${model_path}"_eval \
--source_prefix="${task_name}: " \
${constraint_decoding} ${extra_cmd} \
--per_device_eval_batch_size=${batch} \
--decoding_format ${decoding_format}