mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-11-06 02:42:15 +08:00
parent
21fc00f285
commit
f79d65552c
@ -196,6 +196,7 @@ def load_model_and_tokenizer(
|
|||||||
# Fix LM head (for ChatGLM2 and ChatGLM3)
|
# Fix LM head (for ChatGLM2 and ChatGLM3)
|
||||||
if getattr(config, "model_type", None) == "chatglm":
|
if getattr(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"])
|
||||||
|
|
||||||
# Register auto class to save the custom code files.
|
# Register auto class to save the custom code files.
|
||||||
if isinstance(config, PretrainedConfig) and "AutoConfig" in getattr(config, "auto_map", {}):
|
if isinstance(config, PretrainedConfig) and "AutoConfig" in getattr(config, "auto_map", {}):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user