-
Notifications
You must be signed in to change notification settings - Fork 14
/
run_gen.sh
59 lines (55 loc) · 1.43 KB
/
run_gen.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
export CUDA_VISIBLE_DEVICES=0
TASK=$1
LABEL=all
SAVE_DIR=temp_gen
case $TASK in
MNLI)
NUM_GEN=25000
MAX_LEN=40
TEMP=0
TASK_EXTRA="--pretrain_corpus_dir pretrain_corpus/wiki_short.txt"
;;
QQP)
NUM_GEN=25000
MAX_LEN=50
TEMP=0
TASK_EXTRA="--pretrain_corpus_dir pretrain_corpus/openwebtext_questions.txt"
;;
QNLI)
NUM_GEN=25000
MAX_LEN=100
TEMP=0
TASK_EXTRA="--pretrain_corpus_dir pretrain_corpus/openwebtext_questions.txt"
;;
SST-2)
NUM_GEN=25000
MAX_LEN=40
TEMP=0.2
;;
CoLA)
NUM_GEN=20000
MAX_LEN=40
TEMP=[0.1,10]
;;
RTE)
NUM_GEN=30000
MAX_LEN=40
TEMP=0
TASK_EXTRA="--pretrain_corpus_dir pretrain_corpus/wiki_long.txt"
;;
MRPC)
NUM_GEN=30000
MAX_LEN=40
TEMP=0
TASK_EXTRA="--pretrain_corpus_dir pretrain_corpus/wiki_long.txt"
;;
esac
# Generate training data
python gen_train_data.py --task $TASK --label $LABEL --save_dir $SAVE_DIR --print_res \
--num_gen $NUM_GEN --max_len $MAX_LEN --temperature $TEMP \
$TASK_EXTRA
# Select training data
DATA_DIR=data/${TASK}
NUM_SELECT=6000
python src/gen_utils.py --task $TASK --num_select_samples $NUM_SELECT \
--read_dir $SAVE_DIR --save_dir $DATA_DIR