NS-Genai commited on
Commit
feb6f10
·
verified ·
1 Parent(s): b9ca278

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,19 +1,22 @@
1
- # Use the official image from the library author.
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
- # Copy your model file into the container
9
- # Ensure 'model/gemma-3-finetuned.Q4_K_M.gguf' exists in your Space's file list!
 
 
 
 
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 OpenAI-compatible server
 
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"]