Spaces:
Running
Running
Update Dockerfile
Browse files- 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
|
| 7 |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
RUN pip install --no-cache-dir
|
| 12 |
-
|
| 13 |
-
|
| 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
|