Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Handle older unsloth-zoo without reset_unsloth_gradient_checkpointing_buffers

danielhanchend1d9832e7053
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 9ea57e32d39..88aeeda8a1e 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -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):