Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -1,19 +1,22 @@
|
|
| 1 |
-
# Use the official image
|
| 2 |
-
# This includes the correct pre-compiled binaries and system libraries.
|
| 3 |
FROM ghcr.io/abetlen/llama-cpp-python:latest
|
| 4 |
|
| 5 |
# Set the working directory
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
COPY model/gemma-3-finetuned.Q4_K_M.gguf /app/model/model.gguf
|
| 11 |
|
| 12 |
-
# Set environment variables for the server
|
| 13 |
-
# Hugging Face Spaces requires port 7860
|
| 14 |
ENV HOST=0.0.0.0
|
| 15 |
ENV PORT=7860
|
| 16 |
ENV MODEL=/app/model/model.gguf
|
| 17 |
|
| 18 |
-
# Start the
|
|
|
|
| 19 |
CMD ["python3", "-m", "llama_cpp.server", "--model", "/app/model/model.gguf", "--host", "0.0.0.0", "--port", "7860", "--n_ctx", "2048"]
|
|
|
|
| 1 |
+
# Use the official image which has the library correctly installed
|
|
|
|
| 2 |
FROM ghcr.io/abetlen/llama-cpp-python:latest
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# 1. DO NOT use "COPY . ." or "COPY . /app"
|
| 8 |
+
# This prevents copying any local broken/empty llama_cpp folders.
|
| 9 |
+
|
| 10 |
+
# 2. ONLY copy the model file.
|
| 11 |
+
# Ensure 'model/gemma-3-finetuned.Q4_K_M.gguf' exists in your HF Space "Files" tab.
|
| 12 |
+
# We rename it to 'model.gguf' inside the container for simplicity.
|
| 13 |
COPY model/gemma-3-finetuned.Q4_K_M.gguf /app/model/model.gguf
|
| 14 |
|
| 15 |
+
# 3. Set environment variables for the server
|
|
|
|
| 16 |
ENV HOST=0.0.0.0
|
| 17 |
ENV PORT=7860
|
| 18 |
ENV MODEL=/app/model/model.gguf
|
| 19 |
|
| 20 |
+
# 4. Start the server
|
| 21 |
+
# This runs the installed library from the system paths, ignoring /app
|
| 22 |
CMD ["python3", "-m", "llama_cpp.server", "--model", "/app/model/model.gguf", "--host", "0.0.0.0", "--port", "7860", "--n_ctx", "2048"]
|