Spaces:
Running
Running
Commit ·
e09f03f
1
Parent(s): 33dbb3f
patch qwen3.5 fix
Browse files- Dockerfile +14 -9
Dockerfile
CHANGED
|
@@ -33,7 +33,7 @@ WORKDIR /home/user
|
|
| 33 |
RUN mkdir -p /home/user/code/models && \
|
| 34 |
mkdir -p /home/user/code/app/wwwroot && \
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
-
wget -
|
| 37 |
|
| 38 |
|
| 39 |
# Clone and build OpenBLAS as the non-root user
|
|
@@ -50,13 +50,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 +73,17 @@ 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 |
-
|
|
|
|
| 33 |
RUN mkdir -p /home/user/code/models && \
|
| 34 |
mkdir -p /home/user/code/app/wwwroot && \
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
+
wget -4 --tries=12 --waitretry=2 --retry-connrefused --timeout=30 --no-verbose https://huggingface.co/Mungert/Qwen3-4B-Thinking-2507-GGUF/resolve/main/Qwen3-4B-Thinking-2507-q4_k_m.gguf
|
| 37 |
|
| 38 |
|
| 39 |
# Clone and build OpenBLAS as the non-root user
|
|
|
|
| 50 |
# Switch back to the non-root user
|
| 51 |
USER user
|
| 52 |
|
| 53 |
+
# Clone llama.cpp as the non-root user
|
| 54 |
+
RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
|
|
|
|
| 73 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLLM.git /home/user/code/NetworkMonitorLLM && \
|
| 74 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorData.git /home/user/code/NetworkMonitorData
|
| 75 |
|
| 76 |
+
# Apply llama.cpp patches from NetworkMonitorLLM
|
| 77 |
+
RUN git -C /home/user/code/models/llama.cpp apply \
|
| 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"]
|
|
|