owlninjam commited on
Commit
e366f1f
·
verified ·
1 Parent(s): 575e1e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -2,26 +2,30 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install dependencies
6
  RUN apt-get update && apt-get install -y \
7
- build-essential wget git cmake \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # Clone llama.cpp
11
  RUN git clone https://github.com/ggerganov/llama.cpp
12
 
13
- # Build with cmake
14
  WORKDIR /app/llama.cpp
15
- RUN cmake -B build && cmake --build build --config Release
16
 
17
- # Go back to /app
18
  WORKDIR /app
19
 
20
- # Copy app files
21
  COPY app.py .
22
 
23
- # Expose port
 
 
 
 
24
  EXPOSE 7860
25
 
26
- # Run app
27
- CMD ["python", "app.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install dependencies for building llama.cpp with HTTP server support
6
  RUN apt-get update && apt-get install -y \
7
+ build-essential wget git cmake libcurl4-openssl-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # Clone llama.cpp
11
  RUN git clone https://github.com/ggerganov/llama.cpp
12
 
13
+ # Build llama.cpp with CURL enabled
14
  WORKDIR /app/llama.cpp
15
+ RUN cmake -B build -DLLAMA_CURL=ON && cmake --build build --config Release
16
 
17
+ # Back to /app
18
  WORKDIR /app
19
 
20
+ # Copy Python app
21
  COPY app.py .
22
 
23
+ # Download model file
24
+ RUN wget -O /app/model.gguf \
25
+ https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf
26
+
27
+ # Expose the llama.cpp HTTP server port
28
  EXPOSE 7860
29
 
30
+ # Run the HTTP server
31
+ CMD ["/app/llama.cpp/build/bin/llama-server", "-m", "/app/model.gguf", "-c", "2048", "-t", "2", "--host", "0.0.0.0", "--port", "7860"]