-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmain.sh
executable file
·84 lines (72 loc) · 2.16 KB
/
main.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
#!/bin/bash
###############################################################################
### README ####################################################################
# main script for training models, generating output, calculating metrics
# step 1: set one of the following to "true"
# DO_TRN: fine-tune a model w qlora (train.py)
# DO_RUN: generate outputs from a model (run.py)
# DO_CALC: calculate metrics on output (calc_metrics.py)
# step 2: uncomment desired models, datasets, case_ids (defined in constants.py)
# step 3: save file, run script
###############################################################################
DO_TRN=false
DO_RUN=false
DO_CALC=false
n_samples=250 # n_samples to run, calculate metrics
model_list=(
#flan-t5-xl
#flan-ul2
#vicuna-7b
#alpaca-7b
#med-alpaca-7b
#llama2-7b
#llama2-13b
)
dataset_list=(
#opi
#cxr
#iii
#chq
#pls
#d2n
)
case_id_list=(
#0
#10
#11
#12
#13
#14
#15
#16
#300
)
for j in "${!model_list[@]}"; do
model="${model_list[j]}"
for i in "${!dataset_list[@]}"; do
dataset="${dataset_list[i]}"
for k in "${!case_id_list[@]}"; do
case_id="${case_id_list[k]}"
### train model
if $DO_TRN; then
python src/train.py --model $model \
--case_id $case_id \
--dataset $dataset
fi
### calculate metrics
if $DO_CALC; then
python src/calc_metrics.py --model $model \
--case_id $case_id \
--dataset $dataset \
--n_samples 999999
fi
### generate output
if $DO_RUN; then
python src/run.py --model $model \
--case_id $case_id \
--dataset $dataset \
--n_samples $n_samples
fi
done
done
done