Update Dockerfile
Browse files- Dockerfile +22 -16
Dockerfile
CHANGED
|
@@ -2,26 +2,32 @@ FROM ghcr.io/ggml-org/llama.cpp:full
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
RUN apt update && apt install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN python3 -m venv /opt/venv
|
| 7 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 8 |
|
| 9 |
RUN pip install -U pip huggingface_hub
|
| 10 |
|
| 11 |
-
# تحميل النموذج وملف الرؤية (Vision)
|
| 12 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
CMD ["-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
python3 \
|
| 7 |
+
python3-pip \
|
| 8 |
+
python3-venv \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
RUN python3 -m venv /opt/venv
|
| 12 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 13 |
|
| 14 |
RUN pip install -U pip huggingface_hub
|
| 15 |
|
|
|
|
| 16 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 17 |
+
repo="arabic250/gemma-4-E4B-it-GGUF"; \
|
| 18 |
+
hf_hub_download(repo_id=repo, filename="gemma-4-E4B-it-UD-Q5_K_XL.gguf", local_dir="/app"); \
|
| 19 |
+
hf_hub_download(repo_id=repo, filename="mmproj-BF16.gguf", local_dir="/app")'
|
| 20 |
|
| 21 |
+
# استخدام sh -c لتمرير المتغيرات الديناميكية مثل $(nproc) لمعرفة عدد الأنوية
|
| 22 |
+
CMD ["sh", "-c", "./llama-server \
|
| 23 |
+
-m /app/gemma-4-E4B-it-UD-Q5_K_XL.gguf \
|
| 24 |
+
--mmproj /app/mmproj-BF16.gguf \
|
| 25 |
+
--host 0.0.0.0 \
|
| 26 |
+
--port 7860 \
|
| 27 |
+
-t $(nproc) \
|
| 28 |
+
-tb $(nproc) \
|
| 29 |
+
--cache-type-k q8_0 \
|
| 30 |
+
--cache-type-v q8_0 \
|
| 31 |
+
-fa \
|
| 32 |
+
-c 2048 \
|
| 33 |
+
-n 1024"]
|