Sync Space from local folder
Browse files- Dockerfile +14 -9
Dockerfile
CHANGED
|
@@ -35,7 +35,6 @@ RUN mkdir -p /home/user/code/models && \
|
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
wget -q https://huggingface.co/Mungert/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-q6_k_m.gguf
|
| 37 |
|
| 38 |
-
|
| 39 |
# Clone and build OpenBLAS as the non-root user
|
| 40 |
RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \
|
| 41 |
cd /home/user/code/models/OpenBLAS && \
|
|
@@ -50,13 +49,8 @@ RUN cd /home/user/code/models/OpenBLAS && \
|
|
| 50 |
# Switch back to the non-root user
|
| 51 |
USER user
|
| 52 |
|
| 53 |
-
# Clone
|
| 54 |
-
RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp
|
| 55 |
-
cd /home/user/code/models/llama.cpp && \
|
| 56 |
-
export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATH && \
|
| 57 |
-
cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \
|
| 58 |
-
cmake --build build --config Release -j2 && \
|
| 59 |
-
cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/
|
| 60 |
|
| 61 |
|
| 62 |
|
|
@@ -78,6 +72,18 @@ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
|
| 78 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLLM.git /home/user/code/NetworkMonitorLLM && \
|
| 79 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorData.git /home/user/code/NetworkMonitorData
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
# Copy files into the container as the non-root user
|
| 83 |
COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json
|
|
@@ -104,4 +110,3 @@ RUN cp -r /home/user/code/NetworkMonitorLLM/bin/Release/net10.0/* /home/user/cod
|
|
| 104 |
WORKDIR /home/user/code/app
|
| 105 |
|
| 106 |
CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"]
|
| 107 |
-
|
|
|
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
wget -q https://huggingface.co/Mungert/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-q6_k_m.gguf
|
| 37 |
|
|
|
|
| 38 |
# Clone and build OpenBLAS as the non-root user
|
| 39 |
RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \
|
| 40 |
cd /home/user/code/models/OpenBLAS && \
|
|
|
|
| 49 |
# Switch back to the non-root user
|
| 50 |
USER user
|
| 51 |
|
| 52 |
+
# Clone llama.cpp as the non-root user
|
| 53 |
+
RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
|
|
|
|
| 72 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLLM.git /home/user/code/NetworkMonitorLLM && \
|
| 73 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorData.git /home/user/code/NetworkMonitorData
|
| 74 |
|
| 75 |
+
# Apply llama.cpp patches from NetworkMonitorLLM
|
| 76 |
+
RUN git -C /home/user/code/models/llama.cpp apply \
|
| 77 |
+
/home/user/code/NetworkMonitorLLM/patches/qwen35_imrope_context_shift_fix.diff
|
| 78 |
+
# /home/user/code/NetworkMonitorLLM/patches/qwen35_session_tokens_insert_fix.diff \
|
| 79 |
+
# /home/user/code/NetworkMonitorLLM/patches/qwen35_mrope_kv_restore_fix.diff
|
| 80 |
+
|
| 81 |
+
# Build llama.cpp with OpenBLAS support after patches
|
| 82 |
+
RUN cd /home/user/code/models/llama.cpp && \
|
| 83 |
+
export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATH && \
|
| 84 |
+
cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \
|
| 85 |
+
cmake --build build --config Release -j2 && \
|
| 86 |
+
cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/
|
| 87 |
|
| 88 |
# Copy files into the container as the non-root user
|
| 89 |
COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json
|
|
|
|
| 110 |
WORKDIR /home/user/code/app
|
| 111 |
|
| 112 |
CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"]
|
|
|