This commit is contained in:
hiyouga 2023-12-24 19:20:12 +08:00
parent 6629087e12
commit e4bb846c43
1 changed files with 1 additions and 1 deletions

View File

@ -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()