We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46c70ff commit 75aa7e9Copy full SHA for 75aa7e9
lmdeploy/vl/model/qwen2.py
@@ -75,6 +75,10 @@ def build_model(self):
75
# disable accelerate check_tied_parameters_in_config for Qwen2-VL-2B-Instruct
76
config.tie_word_embeddings = False
77
model = AutoModelCls._from_config(config)
78
+ if hasattr(AutoModelCls, 'visual'):
79
+ # transformers >= 4.52.0 modified model structure
80
+ # https://github.com/huggingface/transformers/blob/v4.52.0/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1791-L1800
81
+ model.visual = model.model.visual
82
del model.model
83
del model.lm_head
84
model.half()
0 commit comments