nihardon commited on
Commit
bba1405
·
verified ·
1 Parent(s): c02dfd8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -8
Dockerfile CHANGED
@@ -1,22 +1,28 @@
 
1
  FROM python:3.9-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
-     ca-certificates \
5
-     libstdc++6 \
6
-     && rm -rf /var/lib/apt/lists/*
7
 
 
8
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel
9
 
10
- # Never build from source
11
  ENV PIP_ONLY_BINARY=:all:
12
 
13
- # Correct version + correct wheel index
 
14
  RUN pip install --no-cache-dir \
15
-     llama-cpp-python==0.2.56 \
16
-     --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
17
 
 
18
  RUN pip install --no-cache-dir "huggingface_hub<0.25.0" gradio
19
 
 
20
  WORKDIR /app
21
  COPY . .
22
- CMD ["python", "app.py"]
 
1
+ # 1. Use Python 3.9 Slim (Good choice)
2
  FROM python:3.9-slim
3
 
4
+ # 2. Install system libraries (Required for the AI engine)
5
  RUN apt-get update && apt-get install -y \
6
+ ca-certificates \
7
+ libstdc++6 \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ # 3. Upgrade pip tools
11
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel
12
 
13
+ # 4. SAFETY LOCK: Prevent compiling (Crucial for speed)
14
  ENV PIP_ONLY_BINARY=:all:
15
 
16
+ # 5. THE FIX: Install llama-cpp-python using the CPU Wheel Server
17
+ # We added '--extra-index-url' so it knows where to find the file.
18
  RUN pip install --no-cache-dir \
19
+ llama-cpp-python==0.2.48 \
20
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
21
 
22
+ # 6. Install the rest (Pinned to prevent the "HfFolder" crash)
23
  RUN pip install --no-cache-dir "huggingface_hub<0.25.0" gradio
24
 
25
+ # 7. Run
26
  WORKDIR /app
27
  COPY . .
28
+ CMD ["python", "app.py"]