chipling commited on
Commit
4c87739
·
verified ·
1 Parent(s): dfada46

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -1,28 +1,29 @@
1
- # Must use 3.10 to match the wheel
2
  FROM python:3.10-slim
3
 
4
  ENV PYTHONUNBUFFERED=1
5
 
6
  WORKDIR /app
7
 
8
- # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
10
  gcc g++ make cmake git libopenblas-dev wget \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Install the NEWER pre-built wheel that supports Qwen 3.5 (v0.3.24)
 
14
  RUN pip install --no-cache-dir \
15
- https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.24-cp310-cp310-linux_x86_64.whl
 
16
 
17
- # Ensure we have the server components
18
- RUN pip install --no-cache-dir "llama-cpp-python[server]" huggingface_hub
19
-
20
- # Model download
21
  RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive', filename='Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf', local_dir='.')"
22
 
23
  EXPOSE 7860
24
 
25
- # Run the server
 
26
  CMD ["python3", "-m", "llama_cpp.server", \
27
  "--model", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
28
  "--host", "0.0.0.0", \
 
1
+ # Python 3.10 is required for these specific wheels
2
  FROM python:3.10-slim
3
 
4
  ENV PYTHONUNBUFFERED=1
5
 
6
  WORKDIR /app
7
 
8
+ # Install basic system tools
9
  RUN apt-get update && apt-get install -y \
10
  gcc g++ make cmake git libopenblas-dev wget \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 1. Install llama-cpp-python from the official CPU wheel index
14
+ # This skips the 'stuck' compilation and provides the latest architecture support
15
  RUN pip install --no-cache-dir \
16
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
17
+ "llama-cpp-python[server]"
18
 
19
+ # 2. Download the model (Qwen 3.5 4B)
20
+ RUN pip install huggingface_hub
 
 
21
  RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive', filename='Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf', local_dir='.')"
22
 
23
  EXPOSE 7860
24
 
25
+ # 3. Launch the server
26
+ # Note: n_threads is set to 2 to match the Free Tier CPU limit
27
  CMD ["python3", "-m", "llama_cpp.server", \
28
  "--model", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
29
  "--host", "0.0.0.0", \