Handle older unsloth-zoo without reset_unsloth_gradient_checkpointing_buffers
This commit is contained in:
parent
762ef9a20f
commit
d1d9832e70
1 changed files with 4 additions and 1 deletions
|
|
@ -234,7 +234,10 @@ from transformers.training_args import ParallelMode
|
|||
# Also patches W&B since multiple runs must use wandb.finish()
|
||||
import functools
|
||||
from types import MethodType
|
||||
from unsloth_zoo.gradient_checkpointing import reset_unsloth_gradient_checkpointing_buffers
|
||||
try:
|
||||
from unsloth_zoo.gradient_checkpointing import reset_unsloth_gradient_checkpointing_buffers
|
||||
except:
|
||||
def reset_unsloth_gradient_checkpointing_buffers(): pass
|
||||
def prepare_for_training_mode(f):
|
||||
@functools.wraps(f)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue