cigol123 commited on
Commit
52edec5
·
verified ·
1 Parent(s): a2b69dd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -1,21 +1,24 @@
1
  FROM python:3.9-slim
2
 
3
- # Install build essentials for llama-cpp-python
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  wget \
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # Set environment variables for llama-cpp optimizations
10
  ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DLLAMA_AVX=ON -DLLAMA_AVX2=ON -DLLAMA_F16C=ON -DLLAMA_FMA=ON"
11
  ENV FORCE_CMAKE=1
 
 
12
 
13
  RUN useradd -m -u 1000 user
14
  USER user
15
  ENV PATH="/home/user/.local/bin:$PATH"
16
  WORKDIR /app
17
 
18
- # Download model
19
  RUN wget https://huggingface.co/cigol123/YugoGPT-Q4_0-GGUF/resolve/main/yugogpt-q4_0.gguf
20
 
21
  COPY --chown=user ./requirements.txt requirements.txt
@@ -23,4 +26,3 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
  COPY --chown=user . /app
25
  CMD ["python", "app.py"]
26
-
 
1
  FROM python:3.9-slim
2
 
3
+ # Install build essentials and OpenBLAS
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  wget \
7
+ libopenblas-dev \
8
+ ninja-build \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Set environment variables for optimal performance
12
  ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DLLAMA_AVX=ON -DLLAMA_AVX2=ON -DLLAMA_F16C=ON -DLLAMA_FMA=ON"
13
  ENV FORCE_CMAKE=1
14
+ ENV OMP_NUM_THREADS=4
15
+ ENV OPENBLAS_NUM_THREADS=4
16
 
17
  RUN useradd -m -u 1000 user
18
  USER user
19
  ENV PATH="/home/user/.local/bin:$PATH"
20
  WORKDIR /app
21
 
 
22
  RUN wget https://huggingface.co/cigol123/YugoGPT-Q4_0-GGUF/resolve/main/yugogpt-q4_0.gguf
23
 
24
  COPY --chown=user ./requirements.txt requirements.txt
 
26
 
27
  COPY --chown=user . /app
28
  CMD ["python", "app.py"]