英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论