From 9477e7c43fe8c8c0cf46d508bfa594fd767f1089 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 27 Mar 2026 07:47:08 -0700 Subject: [PATCH 1/3] Bump minimum unsloth version to 2026.3.16 in install scripts (#4663) Update install.sh and install.ps1 to require unsloth>=2026.3.16, matching the latest PyPI release. --- install.ps1 | 10 +++++----- install.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/install.ps1 b/install.ps1 index 215c8f6040..f1f16d818d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -681,13 +681,13 @@ shell.Run cmd, 0, False if ($SkipTorch) { # No-torch: install unsloth + unsloth-zoo with --no-deps, then # runtime deps (typer, safetensors, transformers, etc.) with --no-deps. - uv pip install --python $VenvPython --no-deps --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo + uv pip install --python $VenvPython --no-deps --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.16" unsloth-zoo $NoTorchReq = Find-NoTorchRuntimeFile if ($NoTorchReq) { uv pip install --python $VenvPython --no-deps -r $NoTorchReq } } else { - uv pip install --python $VenvPython --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo + uv pip install --python $VenvPython --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.16" unsloth-zoo } if ($StudioLocalInstall) { Write-Host "==> Overlaying local repo (editable)..." @@ -709,7 +709,7 @@ shell.Run cmd, 0, False if ($SkipTorch) { # No-torch: install unsloth + unsloth-zoo with --no-deps, then # runtime deps (typer, safetensors, transformers, etc.) with --no-deps. - uv pip install --python $VenvPython --no-deps --upgrade-package unsloth --upgrade-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo + uv pip install --python $VenvPython --no-deps --upgrade-package unsloth --upgrade-package unsloth-zoo "unsloth>=2026.3.16" unsloth-zoo $NoTorchReq = Find-NoTorchRuntimeFile if ($NoTorchReq) { uv pip install --python $VenvPython --no-deps -r $NoTorchReq @@ -719,7 +719,7 @@ shell.Run cmd, 0, False uv pip install --python $VenvPython -e $RepoRoot --no-deps } } elseif ($StudioLocalInstall) { - uv pip install --python $VenvPython --upgrade-package unsloth "unsloth>=2026.3.14" unsloth-zoo + uv pip install --python $VenvPython --upgrade-package unsloth "unsloth>=2026.3.16" unsloth-zoo Write-Host "==> Overlaying local repo (editable)..." uv pip install --python $VenvPython -e $RepoRoot --no-deps } else { @@ -729,7 +729,7 @@ shell.Run cmd, 0, False # Fallback: GPU detection failed to produce a URL -- let uv resolve torch Write-Host "==> Installing unsloth (this may take a few minutes)..." if ($StudioLocalInstall) { - uv pip install --python $VenvPython unsloth-zoo "unsloth>=2026.3.14" --torch-backend=auto + uv pip install --python $VenvPython unsloth-zoo "unsloth>=2026.3.16" --torch-backend=auto Write-Host "==> Overlaying local repo (editable)..." uv pip install --python $VenvPython -e $RepoRoot --no-deps } else { diff --git a/install.sh b/install.sh index 4c960a129e..b50256ea5a 100755 --- a/install.sh +++ b/install.sh @@ -968,7 +968,7 @@ if [ "$_MIGRATED" = true ]; then # to prevent transitive torch resolution. uv pip install --python "$_VENV_PY" --no-deps \ --reinstall-package unsloth --reinstall-package unsloth-zoo \ - "unsloth>=2026.3.14" unsloth-zoo + "unsloth>=2026.3.16" unsloth-zoo _NO_TORCH_RT="$(_find_no_torch_runtime)" if [ -n "$_NO_TORCH_RT" ]; then uv pip install --python "$_VENV_PY" --no-deps -r "$_NO_TORCH_RT" @@ -976,7 +976,7 @@ if [ "$_MIGRATED" = true ]; then else uv pip install --python "$_VENV_PY" \ --reinstall-package unsloth --reinstall-package unsloth-zoo \ - "unsloth>=2026.3.14" unsloth-zoo + "unsloth>=2026.3.16" unsloth-zoo fi if [ "$STUDIO_LOCAL_INSTALL" = true ]; then echo "==> Overlaying local repo (editable)..." @@ -998,7 +998,7 @@ elif [ -n "$TORCH_INDEX_URL" ]; then # runtime deps (typer, safetensors, transformers, etc.) with --no-deps. uv pip install --python "$_VENV_PY" --no-deps \ --upgrade-package unsloth --upgrade-package unsloth-zoo \ - "unsloth>=2026.3.14" unsloth-zoo + "unsloth>=2026.3.16" unsloth-zoo _NO_TORCH_RT="$(_find_no_torch_runtime)" if [ -n "$_NO_TORCH_RT" ]; then uv pip install --python "$_VENV_PY" --no-deps -r "$_NO_TORCH_RT" @@ -1009,7 +1009,7 @@ elif [ -n "$TORCH_INDEX_URL" ]; then fi elif [ "$STUDIO_LOCAL_INSTALL" = true ]; then uv pip install --python "$_VENV_PY" \ - --upgrade-package unsloth "unsloth>=2026.3.14" unsloth-zoo + --upgrade-package unsloth "unsloth>=2026.3.16" unsloth-zoo echo "==> Overlaying local repo (editable)..." uv pip install --python "$_VENV_PY" -e "$_REPO_ROOT" --no-deps else @@ -1020,7 +1020,7 @@ else # Fallback: GPU detection failed to produce a URL -- let uv resolve torch echo "==> Installing unsloth (this may take a few minutes)..." if [ "$STUDIO_LOCAL_INSTALL" = true ]; then - uv pip install --python "$_VENV_PY" unsloth-zoo "unsloth>=2026.3.14" --torch-backend=auto + uv pip install --python "$_VENV_PY" unsloth-zoo "unsloth>=2026.3.16" --torch-backend=auto echo "==> Overlaying local repo (editable)..." uv pip install --python "$_VENV_PY" -e "$_REPO_ROOT" --no-deps else From 82d14b44d3f4c5c5ac44733bb0a00df197c80bdb Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 27 Mar 2026 08:19:41 -0700 Subject: [PATCH 2/3] fix: preserve Windows drive-letter paths on native Windows (#4665) normalize_path() unconditionally converted Windows paths like C:\Users\... to WSL format /mnt/c/Users/..., which breaks path resolution on native Windows. This caused LM Studio GGUF models to fail detection (detect_gguf_model returned None for the invalid path), falling through to the Unsloth import path which requires a GPU. Now only performs the /mnt/ mapping when actually running under WSL. On native Windows, drive letters are preserved and backslashes are normalized to forward slashes. --- studio/backend/utils/paths/path_utils.py | 36 ++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/studio/backend/utils/paths/path_utils.py b/studio/backend/utils/paths/path_utils.py index 1d6a952399..b38db18286 100644 --- a/studio/backend/utils/paths/path_utils.py +++ b/studio/backend/utils/paths/path_utils.py @@ -6,6 +6,7 @@ Path utilities for model and dataset handling """ import os +import sys from pathlib import Path from typing import Optional import structlog @@ -14,12 +15,33 @@ from loggers import get_logger logger = get_logger(__name__) +def _is_wsl() -> bool: + """Detect if we are running inside WSL (Windows Subsystem for Linux).""" + if sys.platform == "win32": + return False + try: + with open("/proc/version", "r") as f: + return "microsoft" in f.read().lower() + except Exception: + return False + + +_IS_WSL: bool = _is_wsl() + + def normalize_path(path: str) -> str: """ - Convert Windows paths to WSL format if needed. + Normalize filesystem paths for cross-platform use. - Examples: + On WSL, converts Windows drive-letter paths to ``/mnt//...``. + On native Windows, keeps the drive letter and normalizes separators. + On Linux/macOS (non-WSL), paths are returned with forward slashes. + + Examples (WSL): C:\\Users\\... -> /mnt/c/Users/... + Examples (native Windows): + C:\\Users\\... -> C:/Users/... + Examples (Linux/macOS): /home/user/... -> /home/user/... (unchanged) """ if not path: @@ -27,9 +49,13 @@ def normalize_path(path: str) -> str: # Handle Windows drive letters (C:\\ or c:\\) if len(path) >= 3 and path[1] == ":" and path[2] in ("\\", "/"): - drive = path[0].lower() - rest = path[3:].replace("\\", "/") - return f"/mnt/{drive}/{rest}" + # Only map to /mnt// when running under WSL; + # on native Windows the drive letter must be preserved. + if _IS_WSL: + drive = path[0].lower() + rest = path[3:].replace("\\", "/") + return f"/mnt/{drive}/{rest}" + return path.replace("\\", "/") # Already Unix-style or relative return path.replace("\\", "/") From 362ad3606b845c51ae5bf2354ff84d14e6c3356b Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 27 Mar 2026 08:42:00 -0700 Subject: [PATCH 3/3] Update _utils.py --- unsloth/models/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index abdd19c615..4db06606b9 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__ = "2026.3.16" +__version__ = "2026.3.17" __all__ = [ "SUPPORTS_BFLOAT16",