ror-12 commited on
Commit
ffa2d87
·
verified ·
1 Parent(s): 292054e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -17
Dockerfile CHANGED
@@ -1,22 +1,17 @@
1
- # Use a clean, lightweight Python image
2
- FROM python:3.10-slim-bookworm
3
 
4
  WORKDIR /app
5
 
6
- # 1. Install Runtime Dependencies (No compilers needed)
7
- # libopenblas-0: Required for the pre-built AI engine to run
8
- # poppler-utils: Required for PDF
9
- # libgl1: Required for Vision
10
  RUN apt-get update && apt-get install -y \
11
- libopenblas-0 \
12
  poppler-utils \
13
  libgl1 \
14
  libglib2.0-0 \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- # 2. Install Python Packages (STRICT PRE-BUILT MODE)
18
- # --prefer-binary: Tells pip to use the wheel even if it's slightly older
19
- # --extra-index-url: Points to the specific CPU-optimized storage
20
  RUN pip install --no-cache-dir --prefer-binary \
21
  "llama-cpp-python>=0.3.1" \
22
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
@@ -29,14 +24,14 @@ RUN pip install --no-cache-dir \
29
  fastapi \
30
  pillow
31
 
32
- # 3. Download Model (Bartowski's GGUF)
33
- RUN huggingface-cli download bartowski/Qwen2-VL-7B-Instruct-GGUF --include "Qwen2-VL-7B-Instruct-Q4_K_M.gguf" --local-dir /app/model
 
 
 
34
 
35
- # 4. Download Vision Projector
36
- RUN huggingface-cli download bartowski/Qwen2-VL-7B-Instruct-GGUF --include "mmproj-Qwen2-VL-7B-Instruct-f16.gguf" --local-dir /app/model
37
-
38
- # 5. Copy App Code
39
  COPY app.py .
40
 
41
- # 6. Run Server
42
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Full Python 3.10
2
+ FROM python:3.10
3
 
4
  WORKDIR /app
5
 
6
+ # 1. Install System Dependencies
 
 
 
7
  RUN apt-get update && apt-get install -y \
 
8
  poppler-utils \
9
  libgl1 \
10
  libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 2. Install Python Libraries (Pre-built)
14
+ # Llava is fully supported by the standard CPU wheel
 
15
  RUN pip install --no-cache-dir --prefer-binary \
16
  "llama-cpp-python>=0.3.1" \
17
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
24
  fastapi \
25
  pillow
26
 
27
+ # 3. Download Model (Llava v1.6 Mistral)
28
+ # Repo: cjpais/llava-1.6-mistral-7b-gguf
29
+ # We download the Model (Q4_K_M) and the Projector (mmproj)
30
+ RUN huggingface-cli download cjpais/llava-1.6-mistral-7b-gguf --include "llava-v1.6-mistral-7b.Q4_K_M.gguf" --local-dir /app/model
31
+ RUN huggingface-cli download cjpais/llava-1.6-mistral-7b-gguf --include "mmproj-model-f16.gguf" --local-dir /app/model
32
 
33
+ # 4. Copy Code
 
 
 
34
  COPY app.py .
35
 
36
+ # 5. Run Server
37
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]