mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 12:46:07 +08:00
[Misc] Update WeightsMapper for qwen2-vl/qwen2.5-vl (#19054)
Signed-off-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
parent
42243fbda0
commit
ec2dcd80bc
@ -823,7 +823,12 @@ class Qwen2_5_VLForConditionalGeneration(nn.Module, SupportsMultiModal,
|
|||||||
SupportsLoRA, SupportsPP):
|
SupportsLoRA, SupportsPP):
|
||||||
|
|
||||||
# To ensure correct weight loading and mapping.
|
# To ensure correct weight loading and mapping.
|
||||||
hf_to_vllm_mapper = WeightsMapper(orig_to_new_prefix={
|
hf_to_vllm_mapper = WeightsMapper(
|
||||||
|
orig_to_new_prefix={
|
||||||
|
# mapping for new names in checkpoint saved after transformers v4.52
|
||||||
|
"model.language_model.": "language_model.model.",
|
||||||
|
"model.visual.": "visual.",
|
||||||
|
# mapping for original checkpoint
|
||||||
"lm_head.": "language_model.lm_head.",
|
"lm_head.": "language_model.lm_head.",
|
||||||
"model.": "language_model.model.",
|
"model.": "language_model.model.",
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1071,7 +1071,12 @@ class Qwen2VLForConditionalGeneration(nn.Module, SupportsMultiModal,
|
|||||||
SupportsLoRA, SupportsPP):
|
SupportsLoRA, SupportsPP):
|
||||||
|
|
||||||
# To ensure correct weight loading and mapping.
|
# To ensure correct weight loading and mapping.
|
||||||
hf_to_vllm_mapper = WeightsMapper(orig_to_new_prefix={
|
hf_to_vllm_mapper = WeightsMapper(
|
||||||
|
orig_to_new_prefix={
|
||||||
|
# mapping for new names in checkpoint saved after transformers v4.52
|
||||||
|
"model.language_model.": "language_model.model.",
|
||||||
|
"model.visual.": "visual.",
|
||||||
|
# mapping for original checkpoint
|
||||||
"lm_head.": "language_model.lm_head.",
|
"lm_head.": "language_model.lm_head.",
|
||||||
"model.": "language_model.model.",
|
"model.": "language_model.model.",
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user