fix: use unsloth[huggingfacenotorch] instead of --no-deps in no-torch mode (#4647)
The previous --no-deps approach skipped ALL dependencies, not just torch. This left safetensors, transformers, datasets, accelerate, etc. missing, causing PackageNotFoundError at runtime. Fix: in no-torch mode, install unsloth[huggingfacenotorch] (which pulls all runtime deps except torch), then install unsloth-zoo with --no-deps (since zoo's published metadata still declares torch as a hard dep). This gives a working no-torch environment with all non-torch packages. Applied to all three installer files: install.sh, install.ps1, and studio/install_python_stack.py.
This commit is contained in:
parent
2ffc8d2cea
commit
3c9f0ed149
3 changed files with 56 additions and 21 deletions
|
|
@ -440,17 +440,24 @@ 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 unsloth + unsloth-zoo without torch deps
|
||||
# No-torch mode: install runtime deps via [huggingfacenotorch] extras
|
||||
# (safetensors, transformers, datasets, etc.), then unsloth-zoo with
|
||||
# --no-deps to avoid pulling torch.
|
||||
_progress("base packages (no torch)")
|
||||
pip_install(
|
||||
"Updating base packages (no-torch mode)",
|
||||
"Installing unsloth runtime deps (no-torch mode)",
|
||||
"--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",
|
||||
"--upgrade-package",
|
||||
"unsloth-zoo",
|
||||
req = REQ_ROOT / "base.txt",
|
||||
"unsloth-zoo",
|
||||
)
|
||||
if local_repo:
|
||||
pip_install(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue