Andrew McCracken
commited on
Commit
·
8e854ef
1
Parent(s):
a922ca8
Fix: Install cmake and build-essential for llama-cpp-python build
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -2,23 +2,21 @@ FROM python:3.12-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy requirements and install
|
| 13 |
COPY requirements.txt .
|
| 14 |
|
| 15 |
-
# Set environment variables
|
| 16 |
-
ENV CMAKE_ARGS="-DLLAMA_BLAS=OFF -
|
| 17 |
-
ENV FORCE_CMAKE=0
|
| 18 |
|
| 19 |
-
# Install llama-cpp-python
|
| 20 |
-
RUN pip install --no-cache-dir
|
| 21 |
-
pip install --no-cache-dir llama-cpp-python==0.3.14
|
| 22 |
|
| 23 |
# Install remaining requirements
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies for building llama-cpp-python
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
| 8 |
+
cmake \
|
| 9 |
+
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy requirements and install
|
| 13 |
COPY requirements.txt .
|
| 14 |
|
| 15 |
+
# Set environment variables for CPU-only build (no BLAS, no CUDA)
|
| 16 |
+
ENV CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUBLAS=OFF -DLLAMA_METAL=OFF"
|
|
|
|
| 17 |
|
| 18 |
+
# Install llama-cpp-python (will build from source with CPU-only)
|
| 19 |
+
RUN pip install --no-cache-dir llama-cpp-python==0.3.14 --verbose
|
|
|
|
| 20 |
|
| 21 |
# Install remaining requirements
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|