-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_batch_inference_llama.sh
102 lines (96 loc) · 2.05 KB
/
run_batch_inference_llama.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
100
101
#!/usr/bin/env bash
export PYTHONPATH="${PYTHONPATH}:/path/to/your/workspace"
task_name="sst-2"
model_name="/path/to/Llama3-8B-Instruction"
model_type="ibin"
batch_size=16
k_shot=0
n_epochs=10
testing_time=10
combine_first=16
compose_size=2
data_dir="/path/to/your/data/dir"
save_dir="."
adapter_lr="2e-5"
while [[ $# -gt 0 ]]; do
case ${1} in
--task_name)
task_name="${2}"
shift
shift
;;
--model_name)
model_name="${2}"
shift
shift
;;
--combine_first)
combine_first=${2}
shift
shift
;;
--model_type)
model_type="${2}"
shift
shift
;;
--k_shot)
k_shot=${2}
shift
shift
;;
--testing_time)
testing_time="${2}"
shift
shift
;;
--batch_size)
batch_size=${2}
shift
shift
;;
--adapter_lr)
adapter_lr="${2}"
shift
shift
;;
--n_epochs)
n_epochs=${2}
shift
shift
;;
--compose_size)
compose_size=${2}
shift
shift
;;
--data_dir)
data_dir="${2}"
shift
shift
;;
--save_dir)
save_dir="${2}"
shift
shift
;;
*)
echo "cannot recognize ${1}"
shift
;;
esac
done
python batch_inference_llama.py \
--task_name "${task_name}" \
--model_name "${model_name}" \
--model_type "${model_type}" \
--k_shot ${k_shot} \
--adapter_lr "${adapter_lr}" \
--random_seed 42 \
--batch_size ${batch_size} \
--testing_time ${testing_time} \
--n_epochs ${n_epochs} \
--compose_size ${compose_size} \
--combine_first ${combine_first} \
--data_dir "${data_dir}" \
--save_dir "${save_dir}"