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
Bug fixes (#1920)
Daniel Han53d0ba079e09
diff --git a/pyproject.toml b/pyproject.tomlindex 1d206913a93..01636e75f11 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -40,7 +40,7 @@ triton = []huggingface = [- "unsloth_zoo>=2025.3.4",+ "unsloth_zoo>=2025.3.5","packaging","tyro","transformers>=4.46.1,!=4.47.0",@@ -354,7 +354,7 @@ colab-ampere-torch220 = ["flash-attn>=2.6.3",]colab-new = [- "unsloth_zoo>=2025.3.4",+ "unsloth_zoo>=2025.3.5","packaging","tyro","transformers>=4.46.1,!=4.47.0",diff --git a/unsloth/__init__.py b/unsloth/__init__.pyindex 4336ec494bc..9ed356db542 100644--- a/unsloth/__init__.py+++ b/unsloth/__init__.py@@ -198,7 +198,7 @@ pass# Check for unsloth_zootry:unsloth_zoo_version = importlib_version("unsloth_zoo")- if Version(unsloth_zoo_version) < Version("2025.3.4"):+ if Version(unsloth_zoo_version) < Version("2025.3.5"):try:os.system("pip install --upgrade --no-cache-dir --no-deps unsloth_zoo")except:diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex c01e0ccc823..7ac35d71b43 100644--- a/unsloth/models/_utils.py+++ b/unsloth/models/_utils.py@@ -12,7 +12,7 @@# See the License for the specific language governing permissions and# limitations under the License.-__version__ = "2025.3.6"+__version__ = "2025.3.7"__all__ = ["SUPPORTS_BFLOAT16",@@ -1052,8 +1052,7 @@ def _unsloth_pre_compute_loss(self, model, inputs, *args, **kwargs):# Get gradient accumulation steps if possibleif num_items_in_batch is None and \- getattr(self, "args", {}).get("gradient_accumulation_steps", 1) != 1:-+ getattr(getattr(self, "args", self), "gradient_accumulation_steps", 1) != 1:name = (model.base_model.model if hasattr(model, "base_model") else model).__class__.__name__logger.warning_once(f"Unsloth: Not an error, but {name} does not accept `num_items_in_batch`.\n"\diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex 3dacf5cdd54..a490fb8ab42 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -1843,7 +1843,7 @@ class FastLlamaModel:else:inner_training_loop = Trainer._original_training_loopexcept:- raise RuntimeError('Unsloth currently does not support multi GPU setups - but we are working on it!')+ raise RuntimeError('Unsloth: Unsuccessfully patched inner_training_loop')passimport transformers.trainer@@ -1869,7 +1869,7 @@ class FastLlamaModel:f"{chr(92)} / Data Parallel GPUs = {args.world_size} | Total batch size ({self._train_batch_size} x {args.gradient_accumulation_steps} x {args.world_size}) = {total_train_batch_size:,}\\n"\\f' "-____-" Trainable parameters = {get_model_param_count(model, trainable_only=True):,}/{get_model_param_count(model):,} ({get_model_param_count(model, trainable_only=True)/get_model_param_count(model)*100:.2f}% trained)'logger.warning(debug_info)- import subprocess, re, gc+ import gcfor _ in range(3):gc.collect()torch.cuda.empty_cache()"""@@ -1897,9 +1897,6 @@ class FastLlamaModel:"_inner_training_loop","_fast_inner_training_loop", 1,)- exec(inner_training_loop, globals())-- Trainer._inner_training_loop = _fast_inner_training_loopinner_training_loop = inner_training_loop.replace("is_torch_tpu_available()","False",