Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a lean Python base
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Install system dependencies for building C++
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
build-essential \
|
| 7 |
+
git \
|
| 8 |
+
cmake \
|
| 9 |
+
wget \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Clone and build the 1-bit engine (PrismML Fork)
|
| 13 |
+
RUN git clone --depth 1 https://github.com/PrismML-Eng/llama.cpp.git && \
|
| 14 |
+
cd llama.cpp && \
|
| 15 |
+
mkdir build && cd build && \
|
| 16 |
+
cmake .. -DGGML_NATIVE=ON -DCMAKE_BUILD_TYPE=Release && \
|
| 17 |
+
make -j$(nproc)
|
| 18 |
+
|
| 19 |
+
# Setup app directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
COPY . /app
|
| 22 |
+
RUN pip install --no-cache-dir gradio huggingface_hub
|
| 23 |
+
|
| 24 |
+
# Make the binary accessible
|
| 25 |
+
RUN cp /llama.cpp/build/bin/llama-cli /app/llama-cli && chmod +x /app/llama-cli
|
| 26 |
+
|
| 27 |
+
CMD ["python", "app.py"]
|