Spaces:
Running
Running
Dmitry Beresnev commited on
Commit ·
1a4efad
1
Parent(s): 34775a7
change compilation flags
Browse files- Dockerfile +15 -7
Dockerfile
CHANGED
|
@@ -5,9 +5,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 5 |
git \
|
| 6 |
build-essential \
|
| 7 |
cmake \
|
|
|
|
| 8 |
ca-certificates \
|
| 9 |
libcurl4-openssl-dev \
|
| 10 |
libssl-dev \
|
|
|
|
| 11 |
pkg-config \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
@@ -16,15 +18,20 @@ WORKDIR /build
|
|
| 16 |
ARG CACHEBUST=6
|
| 17 |
RUN git clone https://github.com/ggerganov/llama.cpp.git && \
|
| 18 |
cd llama.cpp && \
|
| 19 |
-
cmake -B build -DCMAKE_BUILD_TYPE=Release \
|
|
|
|
|
|
|
| 20 |
-DGGML_NATIVE=OFF \
|
| 21 |
-
-DGGML_AVX2=
|
| 22 |
-
-DGGML_AVX=
|
| 23 |
-
-DGGML_FMA=
|
| 24 |
-
-DGGML_F16C=
|
|
|
|
|
|
|
|
|
|
| 25 |
-DLLAMA_CURL=ON \
|
| 26 |
-DLLAMA_OPENSSL=ON && \
|
| 27 |
-
cmake --build build --config Release --target llama-server -
|
| 28 |
echo "=== Binary dependencies ===" && \
|
| 29 |
ldd build/bin/llama-server || true
|
| 30 |
|
|
@@ -36,6 +43,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 36 |
libcurl4 \
|
| 37 |
ca-certificates \
|
| 38 |
libgomp1 \
|
|
|
|
| 39 |
libstdc++6 \
|
| 40 |
openssl \
|
| 41 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -89,7 +97,7 @@ EXPOSE 7860
|
|
| 89 |
#
|
| 90 |
# Example Qwen2.5 7B Instruct (8k context, safer on 10GB RAM):
|
| 91 |
# Verified llama.cpp args from model card.
|
| 92 |
-
CMD ["llama-server", "--hf-repo", "paultimothymooney/Qwen2.5-7B-Instruct-Q4_K_M-GGUF", "--hf-file", "qwen2.5-7b-instruct-q4_k_m.gguf", "--host", "0.0.0.0", "--port", "7860", "-c", "
|
| 93 |
#
|
| 94 |
# Example Qwen2.5-Coder 7B Instruct (32k context):
|
| 95 |
# CMD ["llama-server", "-hf", "Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:Qwen2.5-Coder-7B-Instruct.Q4_K_M.gguf",
|
|
|
|
| 5 |
git \
|
| 6 |
build-essential \
|
| 7 |
cmake \
|
| 8 |
+
ninja-build \
|
| 9 |
ca-certificates \
|
| 10 |
libcurl4-openssl-dev \
|
| 11 |
libssl-dev \
|
| 12 |
+
libopenblas-dev \
|
| 13 |
pkg-config \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
|
|
| 18 |
ARG CACHEBUST=6
|
| 19 |
RUN git clone https://github.com/ggerganov/llama.cpp.git && \
|
| 20 |
cd llama.cpp && \
|
| 21 |
+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
| 22 |
+
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG" \
|
| 23 |
+
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG" \
|
| 24 |
-DGGML_NATIVE=OFF \
|
| 25 |
+
-DGGML_AVX2=ON \
|
| 26 |
+
-DGGML_AVX=ON \
|
| 27 |
+
-DGGML_FMA=ON \
|
| 28 |
+
-DGGML_F16C=ON \
|
| 29 |
+
-DGGML_OPENMP=ON \
|
| 30 |
+
-DGGML_BLAS=ON \
|
| 31 |
+
-DGGML_BLAS_VENDOR=OpenBLAS \
|
| 32 |
-DLLAMA_CURL=ON \
|
| 33 |
-DLLAMA_OPENSSL=ON && \
|
| 34 |
+
cmake --build build --config Release --target llama-server -j"$(nproc)" && \
|
| 35 |
echo "=== Binary dependencies ===" && \
|
| 36 |
ldd build/bin/llama-server || true
|
| 37 |
|
|
|
|
| 43 |
libcurl4 \
|
| 44 |
ca-certificates \
|
| 45 |
libgomp1 \
|
| 46 |
+
libopenblas0-pthread \
|
| 47 |
libstdc++6 \
|
| 48 |
openssl \
|
| 49 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 97 |
#
|
| 98 |
# Example Qwen2.5 7B Instruct (8k context, safer on 10GB RAM):
|
| 99 |
# Verified llama.cpp args from model card.
|
| 100 |
+
CMD ["llama-server", "--hf-repo", "paultimothymooney/Qwen2.5-7B-Instruct-Q4_K_M-GGUF", "--hf-file", "qwen2.5-7b-instruct-q4_k_m.gguf", "--host", "0.0.0.0", "--port", "7860", "-c", "8192", "-t", "4", "-ngl", "0", "--cont-batching", "-b", "128", "--ubatch-size", "64"]
|
| 101 |
#
|
| 102 |
# Example Qwen2.5-Coder 7B Instruct (32k context):
|
| 103 |
# CMD ["llama-server", "-hf", "Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:Qwen2.5-Coder-7B-Instruct.Q4_K_M.gguf",
|