Spaces:
Running
Running
Soumik Bose commited on
Commit ·
566ab35
1
Parent(s): 2db14a9
ok
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -8,25 +8,26 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
| 13 |
curl \
|
|
|
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
# Create user
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
RUN mkdir -p /app/cache /app/models && chown -R user:user /app
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
# Copy the wheel file you downloaded
|
| 23 |
-
COPY --chown=user:user llama_cpp_python-0.3.16-cp310-cp310-manylinux_2_17_x86_64.whl /tmp/
|
| 24 |
-
|
| 25 |
-
# Install pip
|
| 26 |
RUN pip install --no-cache-dir --upgrade pip
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Install other dependencies
|
| 32 |
COPY --chown=user:user requirements.txt .
|
|
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Install build dependencies
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
+
build-essential \
|
| 14 |
+
cmake \
|
| 15 |
curl \
|
| 16 |
+
git \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
# Create user
|
| 20 |
RUN useradd -m -u 1000 user
|
| 21 |
RUN mkdir -p /app/cache /app/models && chown -R user:user /app
|
| 22 |
|
| 23 |
+
# Install pip as root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
RUN pip install --no-cache-dir --upgrade pip
|
| 25 |
|
| 26 |
+
USER user
|
| 27 |
+
|
| 28 |
+
# Build and install llama-cpp-python with proper flags
|
| 29 |
+
RUN CMAKE_ARGS="-DGGML_BLAS=OFF -DGGML_NATIVE=OFF" \
|
| 30 |
+
pip install --no-cache-dir llama-cpp-python==0.3.2
|
| 31 |
|
| 32 |
# Install other dependencies
|
| 33 |
COPY --chown=user:user requirements.txt .
|