Spaces:
Build error
Build error
Create Dockerfile
Browse files- Dockerfile +44 -0
Dockerfile
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a Python 3.10 base image with Debian Bookworm
|
2 |
+
FROM python:3.10-bookworm
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies, including OpenBLAS, Git, and build tools
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
git \
|
10 |
+
build-essential \
|
11 |
+
cmake \
|
12 |
+
libopenblas-dev \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
# Clone llama-cpp-python repository with submodules
|
16 |
+
RUN git clone --recursive https://github.com/abetlen/llama-cpp-python.git /app/llama-cpp-python
|
17 |
+
|
18 |
+
# Set working directory to llama-cpp-python
|
19 |
+
WORKDIR /app/llama-cpp-python
|
20 |
+
|
21 |
+
# Update llama.cpp submodule to the latest version
|
22 |
+
RUN git submodule update --remote vendor/llama.cpp
|
23 |
+
|
24 |
+
# Set environment variables for building with OpenBLAS
|
25 |
+
ENV FORCE_CMAKE=1
|
26 |
+
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DLLAMA_CURL=OFF"
|
27 |
+
|
28 |
+
# Install llama-cpp-python from source
|
29 |
+
RUN pip install . --upgrade --force-reinstall --no-cache-dir
|
30 |
+
|
31 |
+
# Copy your application code
|
32 |
+
COPY app.py /app/
|
33 |
+
|
34 |
+
# Install additional Python dependencies for your app
|
35 |
+
RUN pip install gradio huggingface_hub
|
36 |
+
|
37 |
+
# Set working directory for the application
|
38 |
+
WORKDIR /app
|
39 |
+
|
40 |
+
# Expose port for Gradio (default is 7860)
|
41 |
+
EXPOSE 7860
|
42 |
+
|
43 |
+
# Command to run your application
|
44 |
+
CMD ["python", "app.py"]
|