Reduce AutoWeightsLoader kwargs (#53106)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -415,18 +415,17 @@ class Eagle3LlamaForCausalLM(LlamaForCausalLM):
|
||||
"Please provide mask_hidden in the weights."
|
||||
)
|
||||
|
||||
skip_substrs = ["mask_hidden"]
|
||||
orig_to_new_substr = {"mask_hidden": 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
|
||||
if not self.model.use_aux_hidden_state:
|
||||
skip_substrs.append("fc.")
|
||||
orig_to_new_substr["fc."] = None
|
||||
if not self.model.norm_before_fc:
|
||||
skip_substrs.append("input_norm.")
|
||||
loader = AutoWeightsLoader(
|
||||
self,
|
||||
skip_prefixes=None,
|
||||
skip_substrs=skip_substrs,
|
||||
orig_to_new_substr["input_norm."] = None
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user