[Model] Pass param prefix to LLMHead (#24862)

Signed-off-by: whx-sjtu <2952154980@qq.com>
This commit is contained in:
whx
2025-09-17 16:01:27 +08:00
committed by GitHub
parent 03191cd8f0
commit 4a9375fe9d
58 changed files with 102 additions and 31 deletions

View File

@@ -375,7 +375,9 @@ class OPTForCausalLM(nn.Module, SupportsPP):
self.lm_head = self.model.decoder.embed_tokens
else:
self.lm_head = ParallelLMHead(config.vocab_size,
config.word_embed_proj_dim)
config.word_embed_proj_dim,
prefix=maybe_prefix(
prefix, "lm_head"))
self.logits_processor = LogitsProcessor(config.vocab_size)
self.make_empty_intermediate_tensors = (
self.model.make_empty_intermediate_tensors)