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.

Update _utils.py

Daniel Hanb7131a069707
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index 377db89cc07..a21fdd857c4 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -958,10 +958,10 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches):
# Check if model allows **kwargs
m = self.model
- while hasattr(m, "model"):
- # Stop at last model entry
- if not hasattr(m, "model") or not hasattr(m, "forward"): break
- m = m.model
+ # while hasattr(m, "model"):
+ # # Stop at last model entry
+ # if not hasattr(m, "model") or not hasattr(m, "forward"): break
+ # m = m.model
signature = inspect.signature(m.forward).parameters.values()
has_kwargs = tuple(signature)[-1].kind == inspect._VAR_KEYWORD
print(m.forward, signature, has_kwargs)