Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,19 +1,20 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
| 5 |
-
build-essential \
|
| 6 |
-
python3-dev \
|
| 7 |
-
wget \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
RUN wget -q -O model.gguf https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf
|
| 12 |
|
| 13 |
-
# Install
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
COPY app.py .
|
| 17 |
|
| 18 |
-
# Port 7860
|
| 19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install wget to get the model
|
| 4 |
+
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# 1. Download the GGUF model (Quiet mode)
|
| 7 |
RUN wget -q -O model.gguf https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf
|
| 8 |
|
| 9 |
+
# 2. Install llama-cpp-python using a PRE-BUILT wheel
|
| 10 |
+
# This skips the "Building wheel" phase and finishes in seconds
|
| 11 |
+
RUN pip install --no-cache-dir \
|
| 12 |
+
https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl
|
| 13 |
+
|
| 14 |
+
# 3. Install web server basics
|
| 15 |
+
RUN pip install --no-cache-dir fastapi uvicorn
|
| 16 |
|
| 17 |
COPY app.py .
|
| 18 |
|
| 19 |
+
# Port 7860 for Hugging Face
|
| 20 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|