mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-16 00:28:10 +08:00
parent
400ae144a4
commit
4ce4172c87
@ -57,3 +57,7 @@ def prepare_valuehead_model(model: "PreTrainedModel") -> None:
|
|||||||
if getattr(model.config, "model_type", None) == "chatglm":
|
if getattr(model.config, "model_type", None) == "chatglm":
|
||||||
setattr(model, "lm_head", model.transformer.output_layer)
|
setattr(model, "lm_head", model.transformer.output_layer)
|
||||||
setattr(model, "_keys_to_ignore_on_save", ["lm_head.weight"])
|
setattr(model, "_keys_to_ignore_on_save", ["lm_head.weight"])
|
||||||
|
|
||||||
|
if getattr(model.config, "model_type", None) == "internlm2":
|
||||||
|
setattr(model, "lm_head", model.output)
|
||||||
|
setattr(model, "_keys_to_ignore_on_save", ["lm_head.weight"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user