CooLLaMACEO commited on
Commit
4cd1eae
·
verified ·
1 Parent(s): 7c054f7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,23 +1,20 @@
1
- # Using bullseye for better compatibility with build tools
2
  FROM python:3.10-bullseye
3
 
4
  WORKDIR /app
5
 
6
- # Install curl to download the model
7
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
8
 
9
- # Fix: This is the magic line that skips the "Building wheel" phase
10
- # It pulls a pre-compiled CPU binary for llama-cpp-python
11
- RUN pip install --no-cache-dir \
12
- fastapi \
13
- uvicorn \
14
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
15
- llama-cpp-python
16
 
17
- # Download MPT-7B Q2
 
18
  RUN curl -L "https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf?download=true" -o mpt-7b-q2.gguf
19
 
20
- # Copy your backend code
21
  COPY app.py .
22
 
23
  EXPOSE 7860
 
 
1
  FROM python:3.10-bullseye
2
 
3
  WORKDIR /app
4
 
5
+ # Install only the essentials
6
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Force PIP to use CPU-only binaries and avoid the build-stage entirely
9
+ ENV PIP_PREFER_BINARY=1
10
+ RUN pip install --no-cache-dir fastapi uvicorn
11
+ RUN pip install llama-cpp-python \
12
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
13
 
14
+ # Download the model (MPT-7B Q2)
15
+ # We do this AFTER the install so if the model fails, we don't have to reinstall tools
16
  RUN curl -L "https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf?download=true" -o mpt-7b-q2.gguf
17
 
 
18
  COPY app.py .
19
 
20
  EXPOSE 7860