Spaces:
Sleeping
Sleeping
use llama-cpp-python wheel from HF dataset
Browse files- Dockerfile +8 -11
Dockerfile
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
-
# Use official
|
| 2 |
-
FROM python:3.10
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git \
|
| 7 |
wget \
|
| 8 |
build-essential \
|
| 9 |
-
cmake \
|
| 10 |
libopenblas-dev \
|
| 11 |
libcurl4-openssl-dev \
|
| 12 |
curl \
|
|
@@ -18,17 +17,15 @@ WORKDIR /app
|
|
| 18 |
# Copy all project files
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
cmake .. -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_SERVER=OFF -DLLAMA_CURL=OFF && \
|
| 26 |
-
cmake --build . --config Release
|
| 27 |
|
| 28 |
-
# Install Python dependencies
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
-
#
|
| 32 |
RUN mkdir -p /app/models && chmod -R 777 /app/models
|
| 33 |
|
| 34 |
# Expose FastAPI port
|
|
|
|
| 1 |
+
# Use official Python image
|
| 2 |
+
FROM python:3.10
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git \
|
| 7 |
wget \
|
| 8 |
build-essential \
|
|
|
|
| 9 |
libopenblas-dev \
|
| 10 |
libcurl4-openssl-dev \
|
| 11 |
curl \
|
|
|
|
| 17 |
# Copy all project files
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
+
# Download and install llama-cpp-python prebuilt wheel from Hugging Face Dataset
|
| 21 |
+
RUN wget https://huggingface.co/datasets/Kalpokoch/wheel-llama/resolve/main/llama_cpp_python-0.3.13-cp311-cp311-linux_x86_64.whl -O llama_cpp_python.whl && \
|
| 22 |
+
pip install llama_cpp_python.whl && \
|
| 23 |
+
rm llama_cpp_python.whl
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
# Install remaining Python dependencies
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Ensure /app/models exists and is writable
|
| 29 |
RUN mkdir -p /app/models && chmod -R 777 /app/models
|
| 30 |
|
| 31 |
# Expose FastAPI port
|