[CI Bug] Fix ValueError: There is no module or parameter named 'model.vision_tower.vision_model' (#45478)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-06-13 02:38:37 -07:00
committed by GitHub
parent 9261dbbc55
commit 96fa5cdd9e
2 changed files with 10 additions and 6 deletions
@@ -303,17 +303,13 @@ class Base(
- Any quantization config specific mappings
"""
self.hf_to_vllm_mapper = WeightsMapper()
orig_to_new_renamings = self.hf_to_vllm_mapper.orig_to_new_renamings
orig_to_new_regex = self.hf_to_vllm_mapper.orig_to_new_regex
for mapping in get_model_conversion_mapping(self.model):
# Handle weights which have been renamed in Transformers
if isinstance(mapping, WeightRenaming):
# Recompile using regex (Transformers used re)
compiled_sources = re.compile(
mapping.compiled_sources.pattern, mapping.compiled_sources.flags
)
target_pattern = mapping.target_patterns[0]
orig_to_new_regex[compiled_sources] = target_pattern
orig_to_new_renamings.append(mapping)
# TODO: Handle WeightConverter to enable layer merging
# Handle unexpected weights which should be ignored