nihardon commited on
Commit
09e4ad5
·
verified ·
1 Parent(s): 40250a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -15
Dockerfile CHANGED
@@ -1,24 +1,28 @@
1
- # 1. Use Python 3.9 (This is the version that worked for you)
2
- FROM python:3.9
3
 
4
- # 2. Upgrade pip (Essential to find the correct wheels)
 
 
 
 
 
 
 
5
  RUN pip install --no-cache-dir --upgrade pip
6
 
7
- # 3. Install the specific Hugging Face version (Prevents the crash)
8
- RUN pip install "huggingface_hub<0.25.0"
 
9
 
10
- # 4. Install llama-cpp-python
11
- # We use the EXACT method that worked in Turn 16.
12
- # --prefer-binary forces it to download the wheel (fast) instead of building.
13
- RUN pip install --no-cache-dir \
14
- llama-cpp-python \
15
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
16
- --prefer-binary
17
 
18
- # 5. Install Gradio
19
- RUN pip install --no-cache-dir gradio
20
 
21
- # 6. Run the app
 
22
  WORKDIR /app
23
  COPY . .
24
  CMD ["python", "app.py"]
 
1
+ # 1. Use Python 3.9 (Standard, Safe)
2
+ FROM python:3.9-slim
3
 
4
+ # 2. Install wget so we can download the file manually
5
+ # We also update system tools to prevent weird glitches
6
+ RUN apt-get update && apt-get install -y \
7
+ wget \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # 3. CRITICAL: Upgrade pip
12
  RUN pip install --no-cache-dir --upgrade pip
13
 
14
+ # 4. Manually Download the CORRECT Wheel (Bypassing pip's search)
15
+ # We download the 'manylinux' (Standard Linux) version to a file named 'llama.whl'
16
+ RUN wget -O llama.whl https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.56/llama_cpp_python-0.2.56-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
17
 
18
+ # 5. Install the wheel we just downloaded
19
+ RUN pip install llama.whl
 
 
 
 
 
20
 
21
+ # 6. Install the rest (Pinned to prevent the HfFolder crash)
22
+ RUN pip install "huggingface_hub<0.25.0" gradio
23
 
24
+ # 7. Cleanup and Run
25
+ RUN rm llama.whl
26
  WORKDIR /app
27
  COPY . .
28
  CMD ["python", "app.py"]