-
Notifications
You must be signed in to change notification settings - Fork 19
/
run_m_recon_counterfactual.sh
55 lines (44 loc) · 1.46 KB
/
run_m_recon_counterfactual.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
#!/bin/bash
# middle size
# fits to (y | x1x2ysx1m) and (xx2 | x1)
gpu_id=4
is_train=0
test_checkpoint="output/remove_space/train_m_recon_cf/model_best.ckpt"
output_dir="output/m_recon_counterfactual"
config_train=config_train_recon_counterfactual
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
else ## test
# input: x1x2ysx1xx2
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