fix(pkg): pin torch to <2.5.0 to prevent unnecessary downloads

pip's dependency resolution doesn't take into account transitive
dependencies when choosing package versions for download.
Even though `torch=~2.4.1` is required by `diffusers`, pip will
download 2.5.0 and higher, but only install 2.4.1.
Pinning torch to <2.5.0 prevents this behaviour.
This commit is contained in:
Eugene Brodsky 2024-11-01 11:22:44 -04:00 committed by Kent Keirsey
parent 8cf94d602f
commit 6c33e02141

View File

@ -52,7 +52,7 @@ dependencies = [
"sentencepiece==0.2.0",
"spandrel==0.3.4",
"timm==0.6.13", # needed to override timm latest in controlnet_aux, see https://github.com/isl-org/ZoeDepth/issues/26
"torch", # torch and related dependencies are not pinned, resolved as dependency of `diffusers[torch]` and so forth
"torch<2.5.0", # torch and related dependencies are loosely pinned, will respect requirement of `diffusers[torch]`
"torchmetrics",
"torchsde",
"torchvision",