-
Notifications
You must be signed in to change notification settings - Fork 19
/
run_m_supervised.sh
56 lines (45 loc) · 1.44 KB
/
run_m_supervised.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
#!/bin/bash
# middle size
# fits to yy | x1x2ysx1xx2
gpu_id=5
is_train=0
test_checkpoint="output/supervised/train_m_supervised/model_best.ckpt"
output_dir="output/m_supervised"
config_train=config_train_supervised
config_model=configs.config_model_345M
pretrained_model_dir=gpt2_pretrained_models/model_345M
pretrain_checkpoint=gpt2_pretrained_models/model_345M/model.ckpt
mkdir -p ${output_dir}
cp $0 ${output_dir}
cp configs/${config_train}.py ${output_dir}
if [ "$is_train" = 1 ]; then ## train
CUDA_VISIBLE_DEVICES=${gpu_id} \
python3 rewriting_main.py \
--config_model=${config_model} \
--pretrained_model_dir=${pretrained_model_dir} \
--config_train=configs.${config_train} \
--pretrain_checkpoint=${pretrain_checkpoint} \
--output_dir=${output_dir} \
--do_train \
--supervised
else ## test
# input: x1xx2
CUDA_VISIBLE_DEVICES=${gpu_id} \
python3 rewriting_main.py \
--config_model=${config_model} \
--pretrained_model_dir=${pretrained_model_dir} \
--config_train=configs.${config_train} \
--checkpoint=${test_checkpoint} \
--output_dir=${output_dir} \
--do_test
## input: x1x2
#CUDA_VISIBLE_DEVICES=${gpu_id} \
#python3 rewriting_main.py \
# --config_model=${config_model} \
# --pretrained_model_dir=${pretrained_model_dir} \
# --config_train=configs.${config_train} \
# --test_checkpoint=${test_checkpoint} \
# --output_dir=${output_dir} \
# --do_test \
# --roc
fi