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