-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_qg_exp.sh
100 lines (93 loc) · 3.23 KB
/
run_qg_exp.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
TASK_NAME='qg'
MODEL_NAME='mrm8488/t5-base-finetuned-question-generation-ap'
EX_TIME=$(date +"%Y-%h-%d-(%H:%M)")
echo "=============RUN EXP=============!"
echo 'train->squad -*- eval->openqg'
echo $TASK_NAME
echo $EX_TIME
echo "=============RUN EXP=============!"
python3 pretrain_qg.py \
--task $TASK_NAME \
--model_name_or_path $MODEL_NAME \
--logging_dir "runs/${TASK_NAME}_mrm8488_${EX_TIME}/logs" \
--output_dir "runs/${TASK_NAME}_mrm8488_${EX_TIME}" \
--train_file_path "raw_data/qg_train.json" \
--valid_file_path "raw_data/qg_valid.json" \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 8 \
--gradient_accumulation_steps 4 \
--learning_rate 6.25e-5 \
--num_train_epochs 10 \
--seed 42 \
--do_eval \
--do_predict \
--logging_steps 10 \
--evaluation_strategy "epoch" \
--save_strategy "no" \
--overwrite_output_dir \
--predict_with_generate \
--is_debug_mode -1 || exit
########################################################################################################################
########################################################################################################################
TASK_NAME='qg'
MODEL_NAME='mrm8488/t5-base-finetuned-question-generation-ap'
EX_TIME=$(date +"%Y-%h-%d-(%H:%M)")
echo "=============RUN EXP=============!"
echo 'train->squad-->openqg -*- eval->openqg'
echo $TASK_NAME
echo $EX_TIME
echo "=============RUN EXP=============!"
python3 pretrain_qg.py \
--task $TASK_NAME \
--model_name_or_path $MODEL_NAME \
--logging_dir "runs/${TASK_NAME}_mrm8488_openqg_${EX_TIME}/logs" \
--output_dir "runs/${TASK_NAME}_mrm8488_openqg_${EX_TIME}" \
--train_file_path "raw_data/qg_train.json" \
--valid_file_path "raw_data/qg_valid.json" \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 8 \
--gradient_accumulation_steps 4 \
--learning_rate 6.25e-5 \
--num_train_epochs 10 \
--seed 42 \
--do_train \
--do_eval \
--do_predict \
--logging_steps 10 \
--evaluation_strategy "epoch" \
--save_strategy "no" \
--overwrite_output_dir \
--predict_with_generate \
--is_debug_mode -1 || exit
########################################################################################################################
########################################################################################################################
TASK_NAME='qg'
MODEL_NAME='t5-base'
EX_TIME=$(date +"%Y-%h-%d-(%H:%M)")
echo "=============RUN EXP=============!"
echo 'train->openqg -- eval->openqg'
echo $TASK_NAME
echo $EX_TIME
echo "=============RUN EXP=============!"
python3 pretrain_qg.py \
--task $TASK_NAME \
--model_name_or_path $MODEL_NAME \
--logging_dir "runs/${TASK_NAME}_openqg_t5_${EX_TIME}/logs" \
--output_dir "runs/${TASK_NAME}_openqg_t5_${EX_TIME}" \
--train_file_path "raw_data/qg_train.json" \
--valid_file_path "raw_data/qg_valid.json" \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 8 \
--gradient_accumulation_steps 4 \
--learning_rate 6.25e-5 \
--num_train_epochs 10 \
--seed 42 \
--do_train \
--do_eval \
--do_predict \
--logging_steps 10 \
--evaluation_strategy "epoch" \
--save_strategy "no" \
--overwrite_output_dir \
--predict_with_generate \
--is_debug_mode -1 || exit