-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaatk-dow.sh
64 lines (53 loc) · 1.83 KB
/
aatk-dow.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
#!/bin/bash
# Base command
BASE_CMD="accelerate launch --main_process_port 20394 --num_processes 1 main.py \
--tasks asleep_completion \
--use_auth_token \
--prompt octocoder \
--do_sample True \
--temperature 0.2 \
--n_samples 20 \
--batch_size 1 \
--allow_code_execution \
--save_generations \
--trust_remote_code \
--max_length_generation 1024"
# File path
GENERATIONS_PATH="./generations-asleep_completion-starcoderbase"
EVAL_PATH="./evaluation-asleep_completion-starcoderbase"
PEFT_METHODS=()
PEFT_METHODS=("lora" "ptuning" "ia3" "adapterp" "adapterh" "parallel")
MODELS=("1b" "3b" "7b" "15b")
for MODEL in "${MODELS[@]}"; do
for METHOD in "${PEFT_METHODS[@]}"; do
GEN_FILE="${GENERATIONS_PATH}-${MODEL}-$METHOD.json"
# For 15b model, the name is "starcoderbase" not "starcoderbase-$MODEL"
if [ "$MODEL" == "15b" ]; then
MODEL_NAME="starcoderbase"
else
MODEL_NAME="starcoderbase-$MODEL"
fi
CMD="$BASE_CMD \
--model bigcode/$MODEL_NAME \
--peft_model bigcode/${MODEL_NAME/starcoderbase/astraios}-$METHOD \
--save_generations_path $GEN_FILE \
--metric_output_path ${EVAL_PATH}-${MODEL}-$METHOD.json"
# Execute the command
sh -c "$CMD"
echo "-----------------------------------------"
done
GEN_FILE="${GENERATIONS_PATH}-${MODEL}-fft.json"
# For 15b model, the name is "astraios" not "astraios-$MODEL"
if [ "$MODEL" == "15b" ]; then
FFT_MODEL_NAME="astraios-fft"
else
FFT_MODEL_NAME="astraios-$MODEL-fft"
fi
CMD="$BASE_CMD \
--model bigcode/$FFT_MODEL_NAME \
--save_generations_path $GEN_FILE \
--metric_output_path ${EVAL_PATH}-${MODEL}-fft.json"
# Execute the command for "fft" method
sh -c "$CMD"
echo "-----------------------------------------"
done