-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_different_methods_llava-onevision7b.sh
More file actions
193 lines (150 loc) · 7.18 KB
/
test_different_methods_llava-onevision7b.sh
File metadata and controls
193 lines (150 loc) · 7.18 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/bash
source /workspace/.miniconda3/etc/profile.d/conda.sh ##change this to your miniconda/conda path
dataset_name="infovqa_val" ## put any dataset here
#note that the script below can be coded as a loop, however we keep it in seperate parts for illustration purposes
# Set environment variables
export HUGGING_FACE_HUB_TOKEN="put your Hugging Face Token here"
export HF_HOME="$HOME/.cache/huggingface" ##change this if necessary
cd "$(dirname "$(pwd)")" || exit 1
conda activate pactenv
##PACT
export pact_config_path="configs/pact.json"
export log_output_path="logs/pact_llavaonevision_7b"
export cutoff=0.21 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
export pruning_tokeep_percentage_value=0.55 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running PACT on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#Runnig DBDPC
export pact_config_path="configs/dbdpc.json"
export log_output_path="logs/dbdpc_llavaonevision_7b"
export cutoff=0.21 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running DBDPC on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#Runnig EUTI
export pact_config_path="configs/euti.json"
export log_output_path="logs/euti_llavaonevision_7b"
export pruning_tokeep_percentage_value=0.4 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running EUTI on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#FastV
export pact_config_path="configs/fastv.json"
export log_output_path="logs/fastv_llavaonevision_7b"
export pruning_tokeep_percentage_value=0.353 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running FastV on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#TOME
export pact_config_path="configs/tome.json"
export log_output_path="logs/tome_llavaonevision_7b"
export perc_tokeep_tome_total=0.353 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running TOME on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#Vistal Token Withdrawel
export pact_config_path="configs/vtw.json"
export log_output_path="logs/vtw_llavaonevision_7b"
export equivalent_reduc_percentage_vtw=0.353 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running VTW on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#Runnig DPC
export pact_config_path="configs/dpc.json"
export log_output_path="logs/dpc_llavaonevision_7b"
export percentage_to_keep_dpc=0.4 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running DPC on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#K-means
export pact_config_path="configs/kmeans.json"
export log_output_path="logs/kmeans_llavaonevision_7b"
export perc_tokeep_kmeans=0.4 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running K-means on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#agglomerative clustering
export pact_config_path="configs/agglomerative.json"
export log_output_path="logs/agglomerative_llavaonevision_7b"
export percentage_to_keep_agglomerative=0.4 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running agglomerative clustering on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"
#DBSCAN clustering
export pact_config_path="configs/dbscan.json"
export log_output_path="logs/DBSCAN_llavaonevision_7b"
export eps_dbscan=0.7 # This overrides config parameters at runtime, which prevents the need for multiple config files for different hyperparameters
echo "Running DBSCAN clustering on dataset: $dataset_name"
# Run evaluation
python -m lmms_eval \
--model=llava_onevision \
--model_args=pretrained=lmms-lab/llava-onevision-qwen2-7b-ov,device_map=auto,conv_template=qwen_1_5 \
--tasks="$dataset_name" \
--batch_size=1 \
--log_samples \
--log_samples_suffix="llava_one_7b_${dataset_name}" \
--output_path="lmms_eval/logs/"