mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
fix valuehead patch
Former-commit-id: d9cb98362b58b28ae0ee207e7c07e75e5d810876
This commit is contained in:
parent
ccc5b324fe
commit
7168392a51
@ -277,5 +277,6 @@ def patch_valuehead_model(model: "AutoModelForCausalLMWithValueHead") -> None:
|
||||
ignore_modules = [name for name, _ in model.named_parameters() if "pretrained_model" in name]
|
||||
setattr(model, "_keys_to_ignore_on_save", ignore_modules)
|
||||
setattr(model, "_no_split_modules", getattr(model.pretrained_model, "_no_split_modules", None))
|
||||
setattr(model, "dtype", getattr(model.pretrained_model, "dtype", None))
|
||||
setattr(model, "tie_weights", MethodType(tie_weights, model))
|
||||
setattr(model, "get_input_embeddings", MethodType(get_input_embeddings, model))
|
||||
|
Loading…
x
Reference in New Issue
Block a user