Reduce AutoWeightsLoader kwargs (#53106)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user