4n0s commited on
Commit
e640a72
·
verified ·
1 Parent(s): a189905

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,16 +1,19 @@
1
- # Use the official pre-compiled binary from Docker Hub
2
- FROM ggerganov/llama.cpp:server
3
 
4
- # Switch to root to install the downloader
5
- USER root
6
- RUN apt-get update && apt-get install -y python3-pip && rm -rf /var/lib/apt/lists/*
7
- RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
8
 
9
- # Set model details
 
 
 
 
 
 
10
  ENV REPO_ID="tensorblock/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-GGUF"
11
  ENV FILENAME="WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-Q4_K_M.gguf"
12
 
13
- # 1. Download at runtime to avoid build timeout
14
- # 2. Start the pre-compiled server on HF port 7860
15
  CMD python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='$REPO_ID', filename='$FILENAME', local_dir='.')" && \
16
- /llama-server --model ./$FILENAME --host 0.0.0.0 --port 7860 --n-ctx 2048 --threads 2
 
1
+ # Use the official HF Python image - this NEVER fails to pull
2
+ FROM python:3.10-slim
3
 
4
+ # Install system dependencies for runtime
5
+ RUN apt-get update && apt-get install -y libgomp1 wget && rm -rf /var/lib/apt/lists/*
 
 
6
 
7
+ # Install PRE-COMPILED llama-cpp (skips the gcc/compiler step entirely)
8
+ # This wheel is specifically for CPU-based Linux like HF Spaces
9
+ RUN pip install --no-cache-dir \
10
+ https://github.com \
11
+ huggingface_hub llama-cpp-python[server]
12
+
13
+ # Model Details
14
  ENV REPO_ID="tensorblock/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-GGUF"
15
  ENV FILENAME="WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-Q4_K_M.gguf"
16
 
17
+ # RUNTIME: Download and Start
 
18
  CMD python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='$REPO_ID', filename='$FILENAME', local_dir='.')" && \
19
+ python3 -m llama_cpp.server --model ./$FILENAME --host 0.0.0.0 --port 7860 --n_ctx 1024 --n_threads 2