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 -12
View File
@@ -589,7 +589,15 @@ class FireRedLIDForConditionalGeneration(
"net.0": "pre_layer_norm",
"net.1": "linear_expand",
"net.4": "linear_project",
}
},
orig_to_new_prefix={
# Position encoding buffers are rebuilt at init, and the output
# projection is tied to the embedding.
"model.encoder.positional_encoding.pe": None,
"model.decoder.positional_encoding.pe": None,
"model.decoder.tgt_word_prj.weight": None,
"proj_out.": None,
},
)
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
@@ -778,15 +786,5 @@ class FireRedLIDForConditionalGeneration(
return text.strip()
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
loader = AutoWeightsLoader(
self,
skip_prefixes=[
# Position encoding buffers are rebuilt at init
"model.encoder.positional_encoding.pe",
"model.decoder.positional_encoding.pe",
# Tied output projection (shared with embedding)
"model.decoder.tgt_word_prj.weight",
"proj_out.",
],
)
loader = AutoWeightsLoader(self)
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)