-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
45 lines (42 loc) · 1.54 KB
/
run.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
# python shuffle.py
datasets=("advbench")
shots_values=(256 64 32 16 8 4 2 1)
model_names=("Llama-3.1-8B-Instruct")
for dataset in "${datasets[@]}"; do
for model_name in "${model_names[@]}"; do
# 1.jailbreak
for shots in "${shots_values[@]}"; do
echo "Running with shots = $shots"
batch_size=4
CUDA_VISIBLE_DEVICES=4,5,6,7 python main.py \
--model_name $model_name \
--gpus 4 \
--batch_size $batch_size \
--shots $shots \
--dataset $dataset \
> logs/${dataset}/${model_name}_${shots}.log
batch_size=$((batch_size*2))
done
# 2.judge
CUDA_VISIBLE_DEVICES=4,5,6,7 python judge.py --model_name $model_name --dataset $dataset
done
reward=1
for model_name in "${model_names[@]}"; do
# 1.jailbreak
for shots in "${shots_values[@]}"; do
echo "Running with shots = $shots"
batch_size=4
CUDA_VISIBLE_DEVICES=4,5,6,7 python main.py \
--model_name $model_name \
--gpus 4 \
--batch_size $batch_size \
--shots $shots \
--reward $reward \
--dataset $dataset \
> logs/${dataset}/rl_${model_name}_${shots}.log
batch_size=$((batch_size*2))
done
# 2.judge
CUDA_VISIBLE_DEVICES=4,5,6,7 python judge.py --model_name $model_name --reward $reward --dataset $dataset
done
done