sirzmkk commited on
Commit
f23eb54
·
verified ·
1 Parent(s): 6d0df81

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -1,24 +1,28 @@
1
- # Use Python 3.10
2
  FROM python:3.10-slim
3
 
4
- # Install build essentials for llama-cpp
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
- python3-dev \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set working directory
11
  WORKDIR /app
12
 
13
- # Copy requirements and install
 
 
14
  COPY requirements.txt .
 
 
 
 
 
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy the application
18
  COPY . .
19
 
20
- # Expose the Gradio port
21
  EXPOSE 7860
22
 
23
- # Run the app
24
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies needed for building C++ extensions
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
+ cmake \
7
+ gcc \
8
+ g++ \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
11
  WORKDIR /app
12
 
13
+ # Upgrade pip first to handle modern wheels
14
+ RUN pip install --no-cache-dir --upgrade pip
15
+
16
  COPY requirements.txt .
17
+
18
+ # Use the pre-built CPU wheels to avoid long compilation times
19
+ RUN pip install --no-cache-dir llama-cpp-python \
20
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
21
+
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
 
24
  COPY . .
25
 
 
26
  EXPOSE 7860
27
 
 
28
  CMD ["python", "app.py"]