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 (#3322)
Daniel Han977689b2a2bc
diff --git a/pyproject.toml b/pyproject.tomlindex d77683c00a6..8df936f807e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -37,7 +37,7 @@ triton = []huggingface = [- "unsloth_zoo>=2025.9.5",+ "unsloth_zoo>=2025.9.6","packaging","tyro","transformers>=4.51.3,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3,!=4.53.0,!=4.54.0,!=4.55.0,!=4.55.1",@@ -453,7 +453,7 @@ colab-ampere-torch220 = ["flash-attn>=2.6.3",]colab-new = [- "unsloth_zoo>=2025.9.5",+ "unsloth_zoo>=2025.9.6","packaging","tyro","transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3,!=4.53.0,!=4.54.0,!=4.55.0,!=4.55.1",diff --git a/unsloth/__init__.py b/unsloth/__init__.pyindex 8255e505a8d..1be571b69b2 100644--- a/unsloth/__init__.py+++ b/unsloth/__init__.py@@ -240,7 +240,7 @@ elif DEVICE_TYPE == "xpu":# Check for unsloth_zootry:unsloth_zoo_version = importlib_version("unsloth_zoo")- if Version(unsloth_zoo_version) < Version("2025.9.5"):+ if Version(unsloth_zoo_version) < Version("2025.9.6"):print("Unsloth: Please update Unsloth and Unsloth-Zoo to the latest version!\n"\"Do this via `pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth unsloth_zoo`"diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex e3ac56ac834..a559d34ca4c 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.9.4"+__version__ = "2025.9.5"__all__ = ["SUPPORTS_BFLOAT16",@@ -84,7 +84,7 @@ import warnings, subprocess, re, inspect, psutil, os, mathfrom unsloth_zoo.utils import Versionfrom importlib.metadata import version as importlib_versionfrom unsloth import DEVICE_TYPE, DEVICE_COUNT-+from unsloth_zoo.log import loggerfrom unsloth_zoo.tokenizer_utils import (patch_tokenizer as _patch_tokenizer,)@@ -608,12 +608,25 @@ elif DEVICE_TYPE == "hip":elif DEVICE_TYPE == "xpu":SUPPORTS_BFLOAT16 = True-from transformers.models.llama.modeling_llama import logger-# =============================================# Get Xformerstry:from xformers import __version__ as xformers_version+ # [TODO] Xformers does NOT work on RTX 50x (12), B200 (10), Jetson (11)+ # See https://github.com/facebookresearch/xformers/issues/1329+ # CUDA error (/workspace/xfrm2/third_party/flash-attention/hopper/flash_fwd_launch_template.h:188)+ major_version, minor_version = torch.cuda.get_device_capability()+ if (+ (f"{major_version}.{minor_version}" in ("10.0", "11.0", "12.0")) and \+ (Version(xformers_version) in (Version("0.0.32.post2"),))+ ):+ raise NotImplementedError(+ "Unsloth: Xformers does not work in RTX 50X, Blackwell GPUs as of yet. Please build from source via\n"\+ "```\n"\+ "pip install ninja\n"\+ "pip install -v --no-build-isolation -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers\n"\+ "```\n"+ )# Temporarily disable 0.0.27 and higher - inference issuesif False: #Version(xformers_version) >= Version("0.0.27"):raise ImportError(@@ -661,7 +674,9 @@ try:passimport xformers.ops.fmha as xformersxformers_attention = xformers.memory_efficient_attention-except:+except Exception as e:+ print("========\nSwitching to SDPA PyTorch native attention which is slightly slower.\n========\n")+ print(str(e))xformers = Nonexformers_attention = Nonexformers_version = Nonediff --git a/unsloth/models/loader.py b/unsloth/models/loader.pyindex a57deef000a..ab258f3ed99 100644--- a/unsloth/models/loader.py+++ b/unsloth/models/loader.py@@ -622,7 +622,8 @@ class FastModel(FastBaseModel):# Check versionslowered_model_name = model_name.lower()- os.environ["UNSLOTH_MODEL_NAME"] = lowered_model_name+ if os.environ.get("UNSLOTH_MODEL_NAME", "") == "":+ os.environ["UNSLOTH_MODEL_NAME"] = lowered_model_nameLATEST = '\nPlease use transformers via `pip install --no-deps git+https://github.com/huggingface/transformers.git`'NIGHTLY = '\nPlease use nightly transformers via pip install --upgrade "transformers>=4.49.0"`'# Pixtral