cazyundee commited on
Commit
d55cd28
·
verified ·
1 Parent(s): 3956ce2

Test standalone llama server container

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ CUDA_VISIBLE_DEVICES="" \
5
+ GGML_CUDA=0 \
6
+ OMP_NUM_THREADS=16 \
7
+ OMP_THREAD_LIMIT=16 \
8
+ HF_HOME=/data/.cache/huggingface
9
+
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential cmake git ca-certificates \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /opt
15
+ RUN git clone --depth=1 https://github.com/ggml-org/llama.cpp.git \
16
+ && cmake -S llama.cpp -B llama.cpp/build \
17
+ -DGGML_NATIVE=OFF \
18
+ -DGGML_OPENMP=OFF \
19
+ -DGGML_CUDA=OFF \
20
+ -DGGML_AVX=ON \
21
+ -DGGML_AVX2=ON \
22
+ -DGGML_FMA=ON \
23
+ -DGGML_AVX512=OFF \
24
+ -DBUILD_SHARED_LIBS=OFF \
25
+ && cmake --build llama.cpp/build --config Release --target llama-server -j16 \
26
+ && find llama.cpp/build -type f -name llama-server -perm -111 -exec cp {} /usr/local/bin/llama-server \; \
27
+ && test -x /usr/local/bin/llama-server \
28
+ && rm -rf /opt/llama.cpp
29
+
30
+ RUN pip install --no-cache-dir huggingface-hub
31
+
32
+ COPY server_entrypoint.sh /opt/server_entrypoint.sh
33
+ RUN chmod +x /opt/server_entrypoint.sh
34
+
35
+ EXPOSE 7860
36
+ CMD ["/opt/server_entrypoint.sh"]