cloudunity commited on
Commit
c7fbdd0
·
verified ·
1 Parent(s): f8e2432

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -14
Dockerfile CHANGED
@@ -3,6 +3,7 @@ FROM python:3.12-slim
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PYTHONUNBUFFERED=1
5
  ENV PIP_NO_CACHE_DIR=1
 
6
 
7
  WORKDIR /app
8
 
@@ -15,8 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
15
  libgomp1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
-
19
- # Build llama.cpp for CPU.
20
  RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp \
21
  && cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build \
22
  -DGGML_NATIVE=OFF \
@@ -29,21 +28,31 @@ RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp
29
  --target llama-server \
30
  -j2 \
31
  && mkdir -p /opt/llama \
32
- && cp /tmp/llama.cpp/build/bin/llama-server /opt/llama/llama-server \
33
- && cp /tmp/llama.cpp/build/bin/*.so* /opt/llama/ 2>/dev/null || true \
34
  && rm -rf /tmp/llama.cpp
35
 
 
36
 
37
- # Hugging Face downloader.
38
- RUN pip install --upgrade pip \
39
- && pip install huggingface_hub
40
-
41
-
42
- COPY start.sh /app/start.sh
43
- RUN chmod +x /app/start.sh
44
-
45
 
46
  EXPOSE 7860
47
 
48
-
49
- CMD ["/app/start.sh"]
 
 
 
 
 
 
 
 
 
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PYTHONUNBUFFERED=1
5
  ENV PIP_NO_CACHE_DIR=1
6
+ ENV LD_LIBRARY_PATH=/opt/llama
7
 
8
  WORKDIR /app
9
 
 
16
  libgomp1 \
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
 
19
  RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp \
20
  && cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build \
21
  -DGGML_NATIVE=OFF \
 
28
  --target llama-server \
29
  -j2 \
30
  && mkdir -p /opt/llama \
31
+ && cp /tmp/llama.cpp/build/bin/llama-server /opt/llama/ \
32
+ && cp /tmp/llama.cpp/build/bin/*.so* /opt/llama/ \
33
  && rm -rf /tmp/llama.cpp
34
 
35
+ RUN pip install huggingface_hub
36
 
37
+ RUN python3 -c "\
38
+ from huggingface_hub import hf_hub_download; \
39
+ hf_hub_download( \
40
+ repo_id='LiquidAI/LFM2.5-2.6B-GGUF', \
41
+ filename='LFM2.5-2.6B-QAD-Q4_0.gguf', \
42
+ local_dir='/app/models' \
43
+ )"
 
44
 
45
  EXPOSE 7860
46
 
47
+ CMD ["/opt/llama/llama-server", \
48
+ "--model", "/app/models/LFM2.5-2.6B-QAD-Q4_0.gguf", \
49
+ "--host", "0.0.0.0", \
50
+ "--port", "7860", \
51
+ "--alias", "LFM2.5-2.6B", \
52
+ "--threads", "2", \
53
+ "--ctx-size", "32768", \
54
+ "--cache-type-k", "q8_0", \
55
+ "--cache-type-v", "q8_0", \
56
+ "--parallel", "1", \
57
+ "--cont-batching", \
58
+ "--flash-attn", "auto"]