diff --git a/install.ps1 b/install.ps1 index dede04d2c5..df80f23716 100644 --- a/install.ps1 +++ b/install.ps1 @@ -668,10 +668,9 @@ shell.Run cmd, 0, False # in the new venv location, while preserving existing torch/CUDA Write-Host "==> Upgrading unsloth in migrated environment..." if ($SkipTorch) { - # No-torch: install runtime deps via [huggingfacenotorch] extras, - # then unsloth-zoo with --no-deps to avoid pulling torch. - uv pip install --python $VenvPython --reinstall-package unsloth "unsloth[huggingfacenotorch]>=2026.3.14" - uv pip install --python $VenvPython --no-deps --reinstall-package unsloth-zoo unsloth-zoo + # No-torch: install packages without deps to avoid pulling torch. + # Runtime deps are installed by install_python_stack.py via no-torch-runtime.txt. + uv pip install --python $VenvPython --no-deps --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo } else { uv pip install --python $VenvPython --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo } @@ -693,10 +692,9 @@ shell.Run cmd, 0, False Write-Host "==> Installing unsloth (this may take a few minutes)..." if ($SkipTorch) { - # No-torch: install runtime deps via [huggingfacenotorch] extras, - # then unsloth-zoo with --no-deps to avoid pulling torch. - uv pip install --python $VenvPython --upgrade-package unsloth "unsloth[huggingfacenotorch]>=2026.3.14" - uv pip install --python $VenvPython --no-deps --upgrade-package unsloth-zoo unsloth-zoo + # No-torch: install packages without deps to avoid pulling torch. + # Runtime deps are installed by install_python_stack.py via no-torch-runtime.txt. + uv pip install --python $VenvPython --no-deps --upgrade-package unsloth --upgrade-package unsloth-zoo "unsloth>=2026.3.14" unsloth-zoo if ($StudioLocalInstall) { Write-Host "==> Overlaying local repo (editable)..." uv pip install --python $VenvPython -e $RepoRoot --no-deps @@ -737,7 +735,9 @@ shell.Run cmd, 0, False return } # Tell setup.ps1 to skip base package installation (install.ps1 already did it) - $env:SKIP_STUDIO_BASE = "1" + # When no-torch, don't skip base so install_python_stack installs + # no-torch-runtime.txt (the runtime deps that --no-deps skipped). + $env:SKIP_STUDIO_BASE = if ($SkipTorch) { "0" } else { "1" } $env:STUDIO_PACKAGE_NAME = $PackageName $env:UNSLOTH_NO_TORCH = if ($SkipTorch) { "true" } else { "false" } if ($StudioLocalInstall) { diff --git a/install.sh b/install.sh index 3f758527fc..16736b43ee 100755 --- a/install.sh +++ b/install.sh @@ -947,13 +947,12 @@ if [ "$_MIGRATED" = true ]; then # in the new venv location, while preserving existing torch/CUDA echo "==> Upgrading unsloth in migrated environment..." if [ "$SKIP_TORCH" = true ]; then - # No-torch: install runtime deps via [huggingfacenotorch] extras, - # then unsloth-zoo with --no-deps to avoid pulling torch. - uv pip install --python "$_VENV_PY" \ - --reinstall-package unsloth \ - "unsloth[huggingfacenotorch]>=2026.3.14" + # No-torch: install packages without deps to avoid pulling torch. + # Runtime deps (safetensors, transformers, etc.) are installed by + # install_python_stack.py via no-torch-runtime.txt. uv pip install --python "$_VENV_PY" --no-deps \ - --reinstall-package unsloth-zoo unsloth-zoo + --reinstall-package unsloth --reinstall-package unsloth-zoo \ + "unsloth>=2026.3.14" unsloth-zoo else uv pip install --python "$_VENV_PY" \ --reinstall-package unsloth --reinstall-package unsloth-zoo \ @@ -975,13 +974,11 @@ elif [ -n "$TORCH_INDEX_URL" ]; then # Fresh: Step 2 - install unsloth, preserving pre-installed torch echo "==> Installing unsloth (this may take a few minutes)..." if [ "$SKIP_TORCH" = true ]; then - # No-torch: install runtime deps via [huggingfacenotorch] extras, - # then unsloth-zoo with --no-deps to avoid pulling torch. - uv pip install --python "$_VENV_PY" \ - --upgrade-package unsloth \ - "unsloth[huggingfacenotorch]>=2026.3.14" + # No-torch: install packages without deps to avoid pulling torch. + # Runtime deps are installed by install_python_stack.py via no-torch-runtime.txt. uv pip install --python "$_VENV_PY" --no-deps \ - --upgrade-package unsloth-zoo unsloth-zoo + --upgrade-package unsloth --upgrade-package unsloth-zoo \ + "unsloth>=2026.3.14" unsloth-zoo if [ "$STUDIO_LOCAL_INSTALL" = true ]; then echo "==> Overlaying local repo (editable)..." uv pip install --python "$_VENV_PY" -e "$_REPO_ROOT" --no-deps @@ -1039,15 +1036,21 @@ if [ -n "$VENV_ABS_BIN" ]; then fi echo "==> Running unsloth setup..." +# When no-torch, don't skip base so install_python_stack installs +# no-torch-runtime.txt (the runtime deps that --no-deps skipped). +_SKIP_BASE=1 +if [ "$SKIP_TORCH" = true ]; then + _SKIP_BASE=0 +fi if [ "$STUDIO_LOCAL_INSTALL" = true ]; then - SKIP_STUDIO_BASE=1 \ + SKIP_STUDIO_BASE="$_SKIP_BASE" \ STUDIO_PACKAGE_NAME="$PACKAGE_NAME" \ STUDIO_LOCAL_INSTALL=1 \ STUDIO_LOCAL_REPO="$_REPO_ROOT" \ UNSLOTH_NO_TORCH="$SKIP_TORCH" \ bash "$SETUP_SH" =0.42.0 +packaging +numpy +tqdm +psutil +tyro +protobuf +sentencepiece>=0.2.0 +safetensors>=0.4.3 +datasets>=3.4.1,!=4.0.*,!=4.1.0,<4.4.0 +accelerate>=0.34.1 +peft>=0.18.0,!=0.11.0 +huggingface_hub>=0.34.0 +hf_transfer +diffusers +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,!=4.57.0,!=4.57.4,!=4.57.5,!=5.0.0,!=5.1.0,<=5.3.0 +trl>=0.18.2,!=0.19.0,<=0.24.0 +sentence-transformers +cut_cross_entropy +pillow diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py index f6fd38d5d8..d32e29d0f7 100644 --- a/studio/install_python_stack.py +++ b/studio/install_python_stack.py @@ -462,24 +462,14 @@ def install_python_stack() -> int: if skip_base: print(_green(f"✅ {package_name} already installed — skipping base packages")) elif NO_TORCH: - # No-torch mode: install runtime deps via [huggingfacenotorch] extras - # (safetensors, transformers, datasets, etc.), then unsloth-zoo with - # --no-deps to avoid pulling torch. + # No-torch mode: unsloth + unsloth-zoo are already installed with + # --no-deps by install.sh/install.ps1. Install the runtime deps + # (safetensors, transformers, datasets, etc.) from no-torch-runtime.txt. _progress("base packages (no torch)") pip_install( - "Installing unsloth runtime deps (no-torch mode)", + "Installing no-torch runtime deps", "--no-cache-dir", - "--upgrade-package", - "unsloth", - "unsloth[huggingfacenotorch]>=2026.3.14", - ) - pip_install( - "Installing unsloth-zoo (no-torch mode)", - "--no-cache-dir", - "--no-deps", - "--upgrade-package", - "unsloth-zoo", - "unsloth-zoo", + req = REQ_ROOT / "no-torch-runtime.txt", ) if local_repo: pip_install(