benman1 / generative_ai_with_langchain

Build large language model (LLM) apps with Python, ChatGPT and other models. This is the companion repository for the book on generative AI with LangChain.
https://amzn.to/43PuIkQ
MIT License
644 stars 257 forks source link

Building Docker File Error #63

Open wpilgri opened 2 weeks ago

wpilgri commented 2 weeks ago

I am attempting to build the Docker image and am having an issue with the build process.

Run the build command as shown: docker build -t langchain_ai .

The error is related to gpt4all:

=> ERROR [6/8] RUN pip install --prefer-binary --no-cache-dir -r requirements.txt 1.6s


[6/8] RUN pip install --prefer-binary --no-cache-dir -r requirements.txt:
0.377 Collecting accelerate==0.33.0 (from -r requirements.txt (line 1))
0.534 Downloading accelerate-0.33.0-py3-none-any.whl.metadata (18 kB)
0.650 Collecting apify-client==1.6.4 (from -r requirements.txt (line 2))
0.685 Downloading apify_client-1.6.4-py3-none-any.whl.metadata (4.9 kB)
0.728 Collecting arxiv==2.1.0 (from -r requirements.txt (line 3)) 0.763 Downloading arxiv-2.1.0-py3-none-any.whl.metadata (6.1 kB) 0.834 Collecting duckduckgo_search==5.2.1 (from -r requirements.txt (line 4)) 0.869 Downloading duckduckgo_search-5.2.1-py3-none-any.whl.metadata (20 kB) 0.942 Collecting faiss-cpu==1.8.0 (from -r requirements.txt (line 5)) 0.976 Downloading faiss_cpu-1.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (3.6 kB) 1.069 Collecting google-api-python-client==2.124.0 (from -r requirements.txt (line 6)) 1.108 Downloading google_api_python_client-2.124.0-py2.py3-none-any.whl.metadata (6.6 kB) 1.171 Collecting google-cloud-aiplatform==1.60.0 (from -r requirements.txt (line 7)) 1.209 Downloading google_cloud_aiplatform-1.60.0-py2.py3-none-any.whl.metadata (31 kB) 1.297 Collecting google-generativeai==0.4.1 (from -r requirements.txt (line 8)) 1.339 Downloading google_generativeai-0.4.1-py3-none-any.whl.metadata (6.2 kB) 1.385 ERROR: Could not find a version that satisfies the requirement gpt4all==2.3.2 (from versions: 0.1.5, 0.1.6, 0.1.7) 1.591 ERROR: No matching distribution found for gpt4all==2.3.2

Interestingly this command works successfully when setting up an environment on my M3 Max outside of Docker, so is it a Docker issue?

Any suggestions?

benman1 commented 2 days ago

Hi @wpilgri, Sorry for responding a bit late. Thanks for the description.

1.591 ERROR: No matching distribution found for gpt4all==2.3.2

I can see on pypi that there's a Linux version for gpt4all (https://pypi.org/project/gpt4all/2.3.2/#files) - this is confusing. I was building this successfully on my Mac which is a bit older than yours (and I've just built this again) so I am guessing this could be indeed a Docker issue on M3.

I've found a discussion, where someone suggested using a different FROM directive adding the architecture: FROM --platform=linux/amd64 python:3.10-slim

Maybe you could try this? FROM --platform=linux/amd64 continuumio/miniconda3:23.9.0-0

Best, Ben