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
+10 -7
View File
@@ -1056,6 +1056,14 @@ class Gemma3nTextModel(nn.Module, SupportsQuant):
class Gemma3nForCausalLM(nn.Module):
hf_to_vllm_mapper = WeightsMapper(
orig_to_new_substr={
"embed_audio.": None,
"embed_vision.": None,
"audio_tower.": None,
"vision_tower.": None,
}
)
packed_modules_mapping = {
"qkv_proj": [
"q_proj",
@@ -1112,10 +1120,5 @@ class Gemma3nForCausalLM(nn.Module):
return logits
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
loader = AutoWeightsLoader(
self,
skip_substrs=(
["embed_audio.", "embed_vision.", "audio_tower.", "vision_tower."]
),
)
return loader.load_weights(weights)
loader = AutoWeightsLoader(self)
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)