Remove unnecessary load_weights methods (#44589)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-06-29 01:52:23 -07:00
committed by GitHub
parent db28ae2d07
commit 5051698e41
54 changed files with 821 additions and 1975 deletions
+5 -5
View File
@@ -108,11 +108,6 @@ class EagleMistralModel(MistralModel):
hidden_states, _ = self.norm(hidden_states, residual)
return hidden_states, hidden_states
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
# Pretend embed_tokens is loaded; the actual weight is shared
# from the target model at runtime by `load_eagle_model`.
return super().load_weights(weights) | {"embed_tokens.weight"}
class EagleMistralForCausalLM(MistralForCausalLM):
mistral_mapping = MistralForCausalLM.mistral_mapping | {
@@ -166,3 +161,8 @@ class EagleMistralForCausalLM(MistralForCausalLM):
multimodal_embeddings=multimodal_embeddings,
is_multimodal=is_multimodal,
)
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
# Pretend embed_tokens is loaded; the actual weight is shared
# from the target model at runtime by `load_eagle_model`.
return super().load_weights(weights) | {"model.embed_tokens.weight"}