-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhumanevalfixtests.sh
79 lines (65 loc) · 2.47 KB
/
humanevalfixtests.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
#!/bin/bash
LANGS=("python" "java")
for lang in "${LANGS[@]}"; do
# Base command
BASE_CMD="accelerate launch main.py \
--tasks humanevalfixtests-$lang \
--use_auth_token \
--do_sample True \
--temperature 0.2 \
--n_samples 20 \
--batch_size 2 \
--allow_code_execution \
--save_generations \
--trust_remote_code \
--max_length_generation 2048"
# File path
GENERATIONS_PATH="./generations-humanevalfixtests-$lang-starcoderbase"
EVAL_PATH="./evaluation-humanevalfixtests-$lang-starcoderbase"
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"
# Check if the generations file already exists
if [[ -f $GEN_FILE ]]; then
echo "Generations file for $MODEL-$METHOD already exists. Skipping..."
continue
fi
# 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/starcoderbase-$MODEL \
--peft_model bigcode/${MODEL_NAME/starcoderbase/astraios}-$METHOD \
--prompt octocoder \
--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"
# Check for "fft" method
if [[ -f $GEN_FILE ]]; then
echo "Generations file for $MODEL-fft already exists. Skipping..."
continue
fi
# 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
done