4n0s commited on
Commit
bb8c33d
·
verified ·
1 Parent(s): 6c74906

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -17
Dockerfile CHANGED
@@ -1,23 +1,17 @@
1
- # Use Python base image
2
  FROM python:3.10-slim
3
 
4
- # Install system dependencies
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- wget \
8
- && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install llama-cpp-python with server support
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
- ENV MODEL=/model.gguf
 
 
20
 
21
- # Start the OpenAI-compatible server
22
- # We set n_ctx to 2048 to save memory on the free tier
23
- CMD python3 -m llama_cpp.server --model $MODEL --host $HOST --port $PORT --n_ctx 2048
 
 
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