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
+6 -8
View File
@@ -22,6 +22,7 @@ from vllm.model_executor.models.commandr import (
from .utils import (
AutoWeightsLoader,
WeightsMapper,
get_draft_quant_config,
maybe_prefix,
process_eagle_weight,
@@ -145,6 +146,10 @@ class EagleCohereForCausalLM(CohereForCausalLM):
# use tied embeddings so these weights are absent from the draft file.
self.has_own_embed_tokens = False
self.has_own_lm_head = False
if self.config.tie_word_embeddings:
self.hf_to_vllm_mapper = self.hf_to_vllm_mapper | WeightsMapper(
orig_to_new_prefix={"model.embed_tokens.": None}
)
target_layer_num = vllm_config.model_config.get_num_layers(
vllm_config.parallel_config
)
@@ -181,14 +186,7 @@ class EagleCohereForCausalLM(CohereForCausalLM):
process_eagle_weight(self, name)
return name, weight
loader = AutoWeightsLoader(
self,
skip_prefixes=(
["lm_head.", "model.embed_tokens."]
if self.config.tie_word_embeddings
else None
),
)
loader = AutoWeightsLoader(self)
loaded_weight_names = loader.load_weights(
map(_track_and_forward, weights), mapper=self.hf_to_vllm_mapper