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.

Many bug fixes (#2927)

Daniel Han5a2dcc924bd3
diff --git a/pyproject.toml b/pyproject.toml
index 8b24a52a6f4..b538578fd50 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -37,7 +37,7 @@ triton = [
]
huggingface = [
- "unsloth_zoo>=2025.7.1",
+ "unsloth_zoo>=2025.7.2",
"packaging",
"tyro",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3",
@@ -381,7 +381,7 @@ colab-ampere-torch220 = [
"flash-attn>=2.6.3",
]
colab-new = [
- "unsloth_zoo>=2025.7.1",
+ "unsloth_zoo>=2025.7.2",
"packaging",
"tyro",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3",
diff --git a/unsloth/__init__.py b/unsloth/__init__.py
index 4da08da13d2..e965b2959e9 100644
--- a/unsloth/__init__.py
+++ b/unsloth/__init__.py
@@ -79,7 +79,7 @@ def get_device_count():
elif DEVICE_TYPE == "xpu":
return torch.xpu.device_count()
else:
- return 0
+ return 1
pass
DEVICE_COUNT : int = get_device_count()
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index c6ff7b62605..5076c422c81 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.7.1"
+__version__ = "2025.7.2"
__all__ = [
"SUPPORTS_BFLOAT16",
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index db0e8843cf6..8ccdeba3536 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -796,7 +796,7 @@ def LlamaModel_fast_forward(
# Ignore attention_mask
if attention_mask is None:
padding_mask = None
- elif self.training and os.environ.get("UNSLOTH_KEEP_PADDING", "0") != '1':
+ elif self.training:
attention_mask = None
padding_mask = None
else:
diff --git a/unsloth/models/mapper.py b/unsloth/models/mapper.py
index 62259841c5c..f559c6c01e0 100644
--- a/unsloth/models/mapper.py
+++ b/unsloth/models/mapper.py
@@ -899,6 +899,11 @@ __INT_TO_FLOAT_MAPPER = \
"google/gemma-3n-E2B",
"unsloth/gemma-3n-E2B-unsloth-bnb-4bit",
),
+ "unsloth/Devstral-Small-2507-unsloth-bnb-4bit" : (
+ "unsloth/Devstral-Small-2507",
+ "mistralai/Devstral-Small-2507",
+ "unsloth/Devstral-Small-2507-bnb-4bit",
+ ),
}
INT_TO_FLOAT_MAPPER = {}