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
Edits
Daniel Hand28527ce62d1
diff --git a/pyproject.toml b/pyproject.tomlindex 829b35ad3b8..3335a75933a 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -35,7 +35,7 @@ exclude = ["images*"]huggingface = ["packaging","tyro",- "transformers>=4.43.1",+ "transformers>=4.43.2","datasets>=2.16.0","sentencepiece>=0.2.0","tqdm",@@ -188,7 +188,7 @@ colab-ampere-torch220 = [colab-new = ["packaging","tyro",- "transformers>=4.43.1",+ "transformers>=4.43.2","datasets>=2.16.0","sentencepiece>=0.2.0","tqdm",diff --git a/unsloth/__init__.py b/unsloth/__init__.pyindex 265d08c90d4..db54c9a1694 100644--- a/unsloth/__init__.py+++ b/unsloth/__init__.py@@ -60,37 +60,10 @@ except:"We have some installation instructions on our Github page.")pass-# =============================================-# Check if Unsloth's model list has been updated-import os, requests, inspect, re+import os, reimport numpy as npimport subprocess-try:- file_location = inspect.getfile(torch)- package, _ = os.path.split(file_location)- dist_packages, package = os.path.split(package)- old_mapper = os.path.join(dist_packages, "unsloth", "models", "mapper.py")- new_mapper = "https://raw.githubusercontent.com/unslothai/unsloth/main/unsloth/models/mapper.py"- with open(old_mapper, "r") as old_mapper: old_mapper = old_mapper.read()- with requests.get(new_mapper) as new_mapper: new_mapper = new_mapper.text- old_mapper = re.findall(r'\"unsloth\/([^\"]{1,})\-bnb\-4bit\" \: \(', old_mapper)- new_mapper = re.findall(r'\"unsloth\/([^\"]{1,})\-bnb\-4bit\" \: \(', new_mapper)- new_models = list(frozenset(new_mapper) - frozenset(old_mapper))-- print(1)- if len(new_models) != 0:- warnings.warn(- f"Unsloth: Some new models including {new_models} have dropped!\n"\- "If you want to try them out, please update Unsloth via:\n\n"- 'pip install --upgrade --force-reinstall --no-cache-dir \\\n "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"'- )- pass- del new_models, old_mapper, dist_packages, package, file_location-except:- pass-# =============================================-# Hugging Face Hub faster downloads (only enable during Colab and Kaggle sessions)keynames = "\n" + "\n".join(os.environ.keys())if "\nCOLAB_" in keynames or "\nKAGGLE_" in keynames:diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex bc434ecf192..d363539997a 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -18,6 +18,7 @@ from typing import Optional, Tuple, List, Unionfrom ._utils import *from ._utils import __version__from torch.nn.functional import scaled_dot_product_attention+from transformers import __version__ as transformers_versionfrom transformers.models.llama.modeling_llama import (logger,BaseModelOutputWithPast,@@ -1281,7 +1282,7 @@ class FastLlamaModel:max_memory = round(gpu_stats.total_memory / 1024 / 1024 / 1024, 3)statistics = \- f"==((====))== Unsloth: Fast {model_patcher.__name__[4:-5]} patching release {__version__}\n"\+ f"==((====))== Unsloth {__version__}: Fast {model_patcher.__name__[4:-5]} patching. Transformers = {transformers_version}\n"\f" \\\ /| GPU: {gpu_stats.name}. Max memory: {max_memory} GB. Platform = {platform_system}.\n"\f"O^O/ \_/ \\ Pytorch: {torch.__version__}. CUDA = {gpu_stats.major}.{gpu_stats.minor}. CUDA Toolkit = {torch.version.cuda}.\n"\f"\ / Bfloat16 = {str(SUPPORTS_BFLOAT16).upper()}. FA [Xformers = {xformers_version}. FA2 = {HAS_FLASH_ATTENTION}]\n"\diff --git a/unsloth/models/loader.py b/unsloth/models/loader.pyindex 6b83b8e7392..ecf871d5d0c 100644--- a/unsloth/models/loader.py+++ b/unsloth/models/loader.py@@ -27,7 +27,7 @@ transformers_version = Version(transformers_version)SUPPORTS_FOURBIT = transformers_version >= Version("4.37")SUPPORTS_GEMMA = transformers_version >= Version("4.38")SUPPORTS_GEMMA2 = transformers_version >= Version("4.42")-SUPPORTS_LLAMA31 = transformers_version >= Version("4.43.1")+SUPPORTS_LLAMA31 = transformers_version >= Version("4.43.2")if SUPPORTS_GEMMA:from .gemma import FastGemmaModelif SUPPORTS_GEMMA2:@@ -147,8 +147,8 @@ class FastLanguageModel(FastLlamaModel):if scaling_type == "llama3" and not SUPPORTS_LLAMA31:raise ImportError(f"Unsloth: Your transformers version of {transformers_version} does not support Llama 3.1.\n"\- f"The minimum required version is 4.43.1\n"\- f'Try `pip install --upgrade "transformers>=4.43.1"`\n'\+ f"The minimum required version is 4.43.2\n"\+ f'Try `pip install --upgrade "transformers>=4.43.2"`\n'\f"to obtain the latest transformers build, then restart this session."\)dispatch_model = FastLlamaModel