mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-15 16:18:10 +08:00
fix bug
Former-commit-id: b06faa1be3f5aa5e0fa31aa31314c213c36c3442
This commit is contained in:
parent
921f593632
commit
c33fbea469
@ -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