Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +11 -17
Dockerfile
CHANGED
|
@@ -1,23 +1,17 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
RUN
|
| 6 |
-
build-essential \
|
| 7 |
-
wget \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
RUN pip install --no-cache-dir "llama-cpp-python[server]"
|
| 12 |
-
|
| 13 |
-
# Download the WhiteRabbitNeo-2.5 7B GGUF model
|
| 14 |
-
RUN wget https://huggingface.co -O /model.gguf
|
| 15 |
-
|
| 16 |
-
# Set environment variables for the server
|
| 17 |
ENV HOST=0.0.0.0
|
| 18 |
ENV PORT=7860
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
#
|
| 23 |
-
CMD
|
|
|
|
|
|
| 1 |
+
# 1. Use a lightweight base
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# 2. Install only the essential server software (This is fast)
|
| 5 |
+
RUN pip install --no-cache-dir "llama-cpp-python[server]" huggingface_hub
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# 3. Setup environment variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
ENV HOST=0.0.0.0
|
| 9 |
ENV PORT=7860
|
| 10 |
+
# Use the Q3_K_L version - it's smaller (4GB) and less likely to crash the free RAM
|
| 11 |
+
ENV MODEL_REPO="tensorblock/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-GGUF"
|
| 12 |
+
ENV MODEL_FILE="WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-Q3_K_L.gguf"
|
| 13 |
|
| 14 |
+
# 4. THE FIX: Download the model at RUNTIME, not during BUILD
|
| 15 |
+
# This prevents the 'Job Timeout' error
|
| 16 |
+
CMD huggingface-cli download $MODEL_REPO $MODEL_FILE --local-dir . && \
|
| 17 |
+
python3 -m llama_cpp.server --model ./$MODEL_FILE --host $HOST --port $PORT --n_ctx 1024 --n_threads 2
|