mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 12:42:51 +08:00
fix bug
Former-commit-id: e4bb846c43c087bfdd99d0c9eb0318e95b943977
This commit is contained in:
parent
2a3980d6ba
commit
498b83d77a
@ -199,7 +199,7 @@ def _prepare_model_for_training(
|
||||
logger.info("Upcasting layernorm weights in float32.")
|
||||
|
||||
if not model_args.disable_gradient_checkpointing:
|
||||
if getattr(model, "supports_gradient_checkpointing", False):
|
||||
if not getattr(model, "supports_gradient_checkpointing", False):
|
||||
logger.warning("Current model does not support gradient checkpointing.")
|
||||
else:
|
||||
model.enable_input_require_grads()
|
||||
|
Loading…
x
Reference in New Issue
Block a user