Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -3
Dockerfile
CHANGED
@@ -9,7 +9,6 @@ RUN apt-get update && \
|
|
9 |
wget \
|
10 |
curl \
|
11 |
cmake \
|
12 |
-
# python build dependencies \
|
13 |
build-essential \
|
14 |
libssl-dev \
|
15 |
zlib1g-dev \
|
@@ -23,7 +22,7 @@ RUN apt-get update && \
|
|
23 |
libxmlsec1-dev \
|
24 |
libffi-dev \
|
25 |
liblzma-dev \
|
26 |
-
ffmpeg \
|
27 |
libcurl4-openssl-dev \
|
28 |
nvidia-driver-570
|
29 |
|
@@ -44,10 +43,22 @@ RUN pyenv install ${PYTHON_VERSION} && \
|
|
44 |
pip install --no-cache-dir -U pip setuptools wheel && \
|
45 |
pip install "huggingface-hub" "hf-transfer" "gradio[oauth]>=4.28.0" "gradio_huggingfacehub_search==0.0.8" "APScheduler"
|
46 |
|
47 |
-
|
48 |
RUN git clone https://github.com/ggerganov/llama.cpp /app/llama.cpp
|
49 |
RUN pip install -r /app/llama.cpp/requirements.txt
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
COPY groups_merged.txt /app/llama.cpp/
|
52 |
|
53 |
ENV PYTHONPATH=/app \
|
|
|
9 |
wget \
|
10 |
curl \
|
11 |
cmake \
|
|
|
12 |
build-essential \
|
13 |
libssl-dev \
|
14 |
zlib1g-dev \
|
|
|
22 |
libxmlsec1-dev \
|
23 |
libffi-dev \
|
24 |
liblzma-dev \
|
25 |
+
ffmpeg \
|
26 |
libcurl4-openssl-dev \
|
27 |
nvidia-driver-570
|
28 |
|
|
|
43 |
pip install --no-cache-dir -U pip setuptools wheel && \
|
44 |
pip install "huggingface-hub" "hf-transfer" "gradio[oauth]>=4.28.0" "gradio_huggingfacehub_search==0.0.8" "APScheduler"
|
45 |
|
46 |
+
# Clone llama.cpp and install its requirements
|
47 |
RUN git clone https://github.com/ggerganov/llama.cpp /app/llama.cpp
|
48 |
RUN pip install -r /app/llama.cpp/requirements.txt
|
49 |
|
50 |
+
# Build llama.cpp
|
51 |
+
ARG RUN_LOCALLY=false
|
52 |
+
ENV GGML_CUDA=ON
|
53 |
+
RUN if [ "$RUN_LOCALLY" = "true" ]; then export GGML_CUDA=OFF; fi && \
|
54 |
+
echo "GGML_CUDA=$GGML_CUDA" && \
|
55 |
+
cd /app/llama.cpp && \
|
56 |
+
cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=${GGML_CUDA} && \
|
57 |
+
cmake --build build --config Release -j2 --target llama-quantize llama-gguf-split llama-imatrix && \
|
58 |
+
cp ./build/bin/llama-* . && \
|
59 |
+
rm -rf build
|
60 |
+
|
61 |
+
COPY --chown=1000 . /app
|
62 |
COPY groups_merged.txt /app/llama.cpp/
|
63 |
|
64 |
ENV PYTHONPATH=/app \
|