-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_fs_fixed_LLM-scripts.sh
executable file
·72 lines (58 loc) · 2.1 KB
/
run_fs_fixed_LLM-scripts.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
#!/bin/bash
# Define the models and datasets
models=(
# "meta-llama/Llama-2-7b-chat-hf"
# "meta-llama/Llama-2-70b-chat-hf"
# "meta-llama/Llama-2-13b-chat-hf"
# "meta-llama/Meta-Llama-3-8B-Instruct"
"meta-llama/Meta-Llama-3-70B-Instruct"
# "mistralai/Mistral-7B-Instruct-v0.3"
# "mistralai/Mixtral-8x7B-Instruct-v0.1"
# "mistralai/Mixtral-8x22B-v0.1"
# "gpt-3.5-turbo"
)
datasets=(
"inspec"
# "kp20k"
# "semeval2010"
# "semeval2017"
)
output_folder="output"
log_folder="logs"
# Create the folders if it does not exist
mkdir -p ${log_folder}
# Define templates
class_models=(
"LLMRandomTraining"
"LLMRandomButFixedTraining"
"LLMClosestTraining"
)
# Define numbers
numbers=(
"1"
"3"
"5"
)
# Loop over each model and dataset combination
for model in "${models[@]}"
do
for dataset in "${datasets[@]}"
do
for class_model in "${class_models[@]}"
do
for number in "${numbers[@]}"
do
log_file="${log_folder}/${model}-${class_model}_${dataset}_fs_topics${number}.log"
echo "Running model ${model}-${class_model} on dataset ${dataset} with template fewshot_keyword_${number}, output will be logged to ${log_file}"
# Run the command and log the output, continue to next command even if there is an error
python3 main.py --models class=${class_model},prompt=fs_keyphrases,model_name=${model},number_of_examples=${number},load_in_4bit=True --datasets ${dataset} --output ${output_folder} -gpu 1> ${log_file} 2>&1
if [ $? -ne 0 ]; then
echo "Error encountered with model ${model}-${class_model} on dataset ${dataset} using template fewshot_keyword_${number}. Check ${log_file} for details."
else
echo "Successfully completed model ${model}-${class_model} on dataset ${dataset} using template fewshot_keyword_${number}. Log saved to ${log_file}."
fi
done
done
done
done
echo "All tasks have been submitted."