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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update _utils.py
Daniel Han1b71f0885404
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex a21fdd857c4..232f3e3a2f4 100644--- a/unsloth/models/_utils.py+++ b/unsloth/models/_utils.py@@ -958,13 +958,17 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches):# Check if model allows **kwargsm = self.model- # while hasattr(m, "model"):- # # Stop at last model entry- # if not hasattr(m, "model") or not hasattr(m, "forward"): break- # m = m.modelsignature = inspect.signature(m.forward).parameters.values()has_kwargs = tuple(signature)[-1].kind == inspect._VAR_KEYWORD- print(m.forward, signature, has_kwargs)+ if not has_kwargs:+ while hasattr(m, "model"):+ # Stop at last model entry+ if not hasattr(m, "model") or not hasattr(m, "forward"): break+ signature = inspect.signature(m.forward).parameters.values()+ has_kwargs = tuple(signature)[-1].kind == inspect._VAR_KEYWORD+ if has_kwargs: break+ m = m.model+ pass# Iterate to find all batchesfor _ in range(num_batches):