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
@@ -384,18 +384,17 @@ class Eagle3DeepseekV2ForCausalLM(LocalArgmaxMixin, DeepseekV2ForCausalLM):
model_weights[name] = loaded_weight
process_eagle_weight(self, name)
skip_substrs = []
orig_to_new_substr: dict[str, str | None] = {}
if not includes_draft_id_mapping:
skip_substrs.append("draft_id_to_target_id")
orig_to_new_substr["draft_id_to_target_id"] = None
if not includes_embed_tokens:
skip_substrs.append("embed_tokens")
orig_to_new_substr["embed_tokens"] = None
loader = AutoWeightsLoader(
self,
skip_prefixes=None,
skip_substrs=skip_substrs,
loader = AutoWeightsLoader(self)
loader.load_weights(
model_weights.items(),
mapper=WeightsMapper(orig_to_new_substr=orig_to_new_substr),
)
loader.load_weights(model_weights.items())
# Aliases for compatibility