Reduce AutoWeightsLoader kwargs (#53106)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-08-20 15:40:11 +00:00
committed by GitHub
parent 2dd17225c6
commit 1fe3a1571a
84 changed files with 577 additions and 568 deletions
@@ -13,7 +13,7 @@ from .qwen3_vl import (
Qwen3VLMultiModalProcessor,
Qwen3VLProcessingInfo,
)
from .utils import AutoWeightsLoader
from .utils import AutoWeightsLoader, WeightsMapper
class InternS2PreviewProcessingInfo(Qwen3VLProcessingInfo):
@@ -30,9 +30,13 @@ class InternS2PreviewProcessingInfo(Qwen3VLProcessingInfo):
dummy_inputs=Qwen3VLDummyInputsBuilder,
)
class InternS2PreviewForConditionalGeneration(Qwen3_5MoeForConditionalGeneration):
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
loader = AutoWeightsLoader(
self,
skip_prefixes=["mtp.", "model.time_series.", "time_series."],
# `mtp.` is already dropped by `Qwen3_5ForConditionalGeneration`.
hf_to_vllm_mapper = Qwen3_5MoeForConditionalGeneration.hf_to_vllm_mapper | (
WeightsMapper(
orig_to_new_prefix={"model.time_series.": None, "time_series.": None}
)
)
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
loader = AutoWeightsLoader(self)
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)