1

I have integrated the Haystack vector search library into my Django application, and now I'm going through and attempting to turn the project into a Docker container.

Everything is working okay, but I have noticed that when I build my Docker container, a lot of time is being spent on downloading and installing NVIDIA CUDA python packages. I am not deploying my containers on a platform with GPUs, and so I would like to install Haystack without installing the CUDA python packages.

miller9904
  • 109
  • 9

1 Answers1

1

The installation of cuda packages is caused by the torch dependency installed as an extra of the transformers dependency. You can find it in Haystack's pyproject.toml file.

What you can do to prevent that is to install torch with the following command. There is no CPU version of PyTorch on PyPI (tracked by this issue on GitHub) which is why we need to provide an index-url in the command:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
Julian Risch
  • 216
  • 1
  • 4