-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare_prompt_tuning_nci.sh
More file actions
92 lines (86 loc) · 3.62 KB
/
Copy pathprepare_prompt_tuning_nci.sh
File metadata and controls
92 lines (86 loc) · 3.62 KB
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
#!/bin/bash
label="prompt-tuning"
device="cuda"
# datasets=("wn18rr" "geonames" "nci" "snomedct_us" "medcin")
datasets=("nci")
#templates=("template-1" "template-2" "template-3" "template-4" "template-5" "template-6" "template-7" "template-8")
templates=("template-8")
#templates=("template-8")
#models=("llama_7b" "llama3" "llama2" "llama2_chat" "llama3_chat")
models=("bloom_1b7" "bloom_3b" "llama_7b" "llama3" "llama2" "llama2_chat" "llama3_chat")
#models=("bloom_1b7")
train_size="0.05"
soft_prompt="PT"
virtual_token="30"
for kb_name in "${datasets[@]}"; do
index=1
for model_name in "${models[@]}"; do
log="results/$kb_name/$index-$kb_name-$model_name.$label.test.log.txt"
exec > $log
for template in "${templates[@]}"; do
#for train_size in "${train_sizes[@]}"; do
echo "Running on dataset: $kb_name , model: $model_name, template: $template, soft prompt: $soft_prompt , virtual token: $virtual_token, train size: $train_size!"
CUDA_VISIBLE_DEVICES=0 python3 prepare_prompt_tuning.py --kb_name=$kb_name --model_name=$model_name --template=$template --device=$device --soft_prompt=$soft_prompt --virtual_token=$virtual_token --train_size=$train_size
#python3 test.py --kb_name=$kb_name --model_name=$model_name --template=$template --device=$device
echo "Prompt training for $model_name on template: $template is done"
echo "-----------------------------------------------------------"
#done
done
index=$((index+1))
done
done
# datasets=("wn18rr" "nci" "snomedct_us" "medcin")
: 'datasets=("wn18rr")
templates=("template-1" "template-2" "template-3" "template-4" "template-5" "template-6" "template-7" "template-8")
models=("gpt3" "chatgpt")
for kb_name in "${datasets[@]}"; do
index=8
for model_name in "${models[@]}"; do
log="results/$kb_name/$index-$kb_name-$model_name.$label.test.log.txt"
exec > $log
for template in "${templates[@]}"; do
echo "Running on dataset: $kb_name , model: $model_name, template: $template!"
python3 test.py --kb_name=$kb_name --model_name=$model_name --template=$template --device=$device
echo "Inference for $model_name on template: $template is done"
echo "-----------------------------------------------------------"
done
index=$((index+1))
done
done
'
: 'datasets=("geonames")
templates=("template-1")
models=("gpt3" "chatgpt")
for kb_name in "${datasets[@]}"; do
index=10
for model_name in "${models[@]}"; do
log="results/$kb_name/$index-$kb_name-$model_name.$label.test.log.txt"
exec > $log
for template in "${templates[@]}"; do
echo "Running on dataset: $kb_name , model: $model_name, template: $template!"
python3 test.py --kb_name=$kb_name --model_name=$model_name --template=$template --device=$device
echo "Inference for $model_name on template: $template is done"
echo "-----------------------------------------------------------"
done
index=$((index+1))
done
done
'
: ' datasets=("wn18rr" "geonames" "nci" "snomedct_us" "medcin")
templates=("template-3")
models=("gpt4")
for kb_name in "${datasets[@]}"; do
index=12
for model_name in "${models[@]}"; do
log="results/$kb_name/$index-$kb_name-$model_name.$label.test.log.txt"
exec > $log
for template in "${templates[@]}"; do
echo "Running on dataset: $kb_name , model: $model_name, template: $template!"
python3 test.py --kb_name=$kb_name --model_name=$model_name --template=$template --device=$device
echo "Inference for $model_name on template: $template is done"
echo "-----------------------------------------------------------"
done
index=$((index+1))
done
done
'