James040 commited on
Commit
a95609c
·
verified ·
1 Parent(s): 381b08a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -2,18 +2,24 @@ FROM ghcr.io/ggml-org/llama.cpp:full
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt update && apt install -y python3 python3-pip python3-venv curl
6
 
 
7
  RUN python3 -m venv /opt/venv
8
  ENV PATH="/opt/venv/bin:$PATH"
9
 
10
- RUN pip install -U pip huggingface_hub gradio requests
 
 
11
 
12
- # Download SmolLM2-1.7B-Instruct GGUF (Q4_K_M ~1GB, runs well on free CPU)
13
  RUN python3 -c 'from huggingface_hub import hf_hub_download; hf_hub_download(repo_id="bartowski/SmolLM2-1.7B-Instruct-GGUF", filename="SmolLM2-1.7B-Instruct-Q4_K_M.gguf", local_dir="/app")'
14
 
15
  COPY app.py /app/app.py
16
  COPY start.sh /app/start.sh
17
  RUN chmod +x /app/start.sh
18
 
 
 
19
  ENTRYPOINT ["/app/start.sh"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install dependencies
6
  RUN apt update && apt install -y python3 python3-pip python3-venv curl
7
 
8
+ # Create and activate virtual environment
9
  RUN python3 -m venv /opt/venv
10
  ENV PATH="/opt/venv/bin:$PATH"
11
 
12
+ # Force install Gradio 5+ to support 'type="messages"'
13
+ RUN pip install --no-cache-dir -U pip
14
+ RUN pip install --no-cache-dir huggingface_hub "gradio>=5.0" requests
15
 
16
+ # Download SmolLM2-1.7B-Instruct GGUF
17
  RUN python3 -c 'from huggingface_hub import hf_hub_download; hf_hub_download(repo_id="bartowski/SmolLM2-1.7B-Instruct-GGUF", filename="SmolLM2-1.7B-Instruct-Q4_K_M.gguf", local_dir="/app")'
18
 
19
  COPY app.py /app/app.py
20
  COPY start.sh /app/start.sh
21
  RUN chmod +x /app/start.sh
22
 
23
+ # Ensure the venv is used at runtime
24
+ ENV VIRTUAL_ENV=/opt/venv
25
  ENTRYPOINT ["/app/start.sh"]