如何在没有CUDA的情况下安装Haystack?

huangapple go评论71阅读模式
英文:

How do I install Haystack without CUDA?

问题

我已经将Haystack向量搜索库集成到我的Django应用程序中,现在我正在尝试将项目转换为Docker容器。一切都正常运行,但我注意到当构建Docker容器时,花费了大量时间来下载和安装NVIDIA CUDA Python包。我没有在支持GPU的平台上部署容器,所以我希望在安装Haystack时不安装CUDA Python包。

英文:

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.

答案1

得分: 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

英文:

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

huangapple
  • 本文由 发表于 2023年4月6日 23:49:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951432.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定