Skip to content

fix: require torch>=2.6 and torchvision>=0.21 so pip installs upgrade them - #949

Open
cristian-tamblay wants to merge 1 commit into
developfrom
fix/torch-minimum-for-pip-installs
Open

cristian-tamblay wants to merge 1 commit into
developfrom
fix/torch-minimum-for-pip-installs

Conversation

@cristian-tamblay

Copy link
Copy Markdown
Member

Summary

Installs that resolve dependencies from pyproject.toml (pip install -e . and uv pip install -e ., which is what update-server.sh runs, and pip install --upgrade dashai from PyPI) silently lose every HuggingFace model when the environment already has an older torch.

transformers>=5.0.0 has been required since e093c54 (2026-08-24, SAM 3) and shipped in 0.10.0, but torch and torchvision had no minimum. On an environment with torch 2.4.1 already installed, the installer upgrades transformers to the current 5.20 and keeps torch, because a bare torch is satisfied. transformers 5.20 then refuses that torch at import time:

[transformers] Disabling PyTorch because PyTorch >= 2.6 is required but found 2.4.1
[transformers] PyTorch was not found. Models won't be available ...

The app boots and answers normally; text, translation, embedding and image models just cannot run. This is what a server updated with update-server.sh on 2026-10-23 hit.

uv sync was never affected: the lock pins torch 2.11.0+cu128 / 2.13.0 with transformers 5.15.1, a compatible pair. Neither were the PyInstaller bundles or the AppImage, which build from a fresh environment.


Type of Change

Check all that apply like this [x]:

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • pyproject.toml: torch>=2.6 and torchvision>=0.21 (the torchvision release paired with torch 2.6), with a comment on why the minimum exists.
  • uv.lock: only the two specifier entries of the project's own requirements. No resolved version changes; uv lock --check passes.

Testing

Dry runs of uv pip install --dry-run -e . in a venv where torch 2.4.1 and torchvision 0.19.1 appear as installed (stub .dist-info metadata, the same thing the resolver reads on the server):

  • Before: nothing about torch is touched, only new packages get added. This is the broken state.
  • After: torch 2.4.1 -> 2.14.1 and torchvision 0.19.1 -> 0.29.1 are upgraded.

Notes

  • Updates and data: no database or data changes. Existing pip-based installs download a new torch (~3 GB with the CUDA libraries) on their next update, which is the fix.
  • macOS Intel: PyTorch stopped at 2.2.2 there, so pip install dashai will now fail to resolve instead of installing a torch that transformers 5 disables anyway. The README already states there is no Intel build and the publish job for it is continue-on-error.
  • The minimum tracks what the current transformers needs; the pip path always pulls the latest transformers, so it may need bumping again when transformers raises its floor.

… them

transformers 5.20 disables torch below 2.6 at import time, and pyproject
declared torch and torchvision without a minimum. Installs that resolve
from pyproject (pip install -e ., uv pip install -e ., pip install
--upgrade dashai) kept an already installed torch 2.4.1, so the app
booted but no HuggingFace model could run. uv sync was unaffected: the
lock pins a compatible pair.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant