Skip to content

Commit

Permalink
update lvlm (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengtao-lv authored Nov 23, 2024
1 parent 7b5e918 commit d790837
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
46 changes: 46 additions & 0 deletions configs/quantization/methods/Awq/awq_w_only_vlm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
base:
seed: &seed 42
model:
type: model_type
path: model path
tokenizer_mode: slow
torch_dtype: auto
calib:
name: vlm_datastes
type: img_txt
download: False
path: calib data path
n_samples: 128
bs: -1
seq_len: 512
preproc: vlm_general
padding: True
seed: *seed
eval:
eval_pos: [pretrain, fake_quant]
type: img_txt
name: MME
download: False
path: MME dataset path
bs: 16
inference_per_block: False
quant:
method: Awq
quant_objects: [vision, language] # default is [language]
weight:
bit: 4
symmetric: False
granularity: per_group
group_size: 128
special:
trans: True
# The options for "trans_version" include "v1" and "v2".
# But their results don't differ significantly.
trans_version: v2
weight_clip: True
# For 2-bit quantization, setting "clip_sym: False" will yield better results.
clip_sym: True
save:
save_trans: False
save_fake: False
save_path: /path/to/save/
1 change: 1 addition & 0 deletions llmc/models/internvl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,6 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]
1 change: 1 addition & 0 deletions llmc/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,6 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]
1 change: 1 addition & 0 deletions llmc/models/qwen2vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def get_vision_subsets_in_block(self, block):
'inspect': block.mlp.fc2,
'has_kwargs': False,
'is_mlp': True,
'do_trans': False
},
]

Expand Down

0 comments on commit d790837

Please sign in to comment.