Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -12
Dockerfile
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install
|
| 6 |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
-
RUN
|
| 11 |
-
RUN
|
| 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
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
| 1 |
+
# Use the official pre-compiled image (CPU version)
|
| 2 |
+
FROM ghcr.io/abetlen/llama-cpp-python:latest
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# 1. Install curl and move to the right folder
|
| 7 |
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# 2. Download the model using the CLI (most stable)
|
| 10 |
+
RUN pip install huggingface_hub
|
| 11 |
+
RUN huggingface-cli download maddes8cht/mosaicml-mpt-7b-chat-gguf mosaicml-mpt-7b-chat-Q2_K.gguf --local-dir . --local-dir-use-symlinks False
|
| 12 |
+
RUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
# 3. Copy your app code
|
| 15 |
COPY app.py .
|
| 16 |
|
| 17 |
+
# Force the port to 7860 for Hugging Face
|
| 18 |
+
ENV PORT=7860
|
| 19 |
EXPOSE 7860
|
| 20 |
|
| 21 |
+
# Use the python inside the container to run your app
|
| 22 |
+
CMD ["python3", "app.py"]
|