Arabic250 commited on
Commit
658afa7
·
verified ·
1 Parent(s): ca1a1ba

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -22
Dockerfile CHANGED
@@ -2,32 +2,28 @@ FROM ghcr.io/ggml-org/llama.cpp:full
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"]
 
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"]