Kalpokoch commited on
Commit
3c5eae8
·
1 Parent(s): ec3f347

use llama-cpp-python wheel from HF dataset

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,12 +1,11 @@
1
- # Use official slim Python image
2
- FROM python:3.10-slim
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  wget \
8
  build-essential \
9
- cmake \
10
  libopenblas-dev \
11
  libcurl4-openssl-dev \
12
  curl \
@@ -18,17 +17,15 @@ WORKDIR /app
18
  # Copy all project files
19
  COPY . .
20
 
21
- # Clone and build llama.cpp
22
- RUN git clone https://github.com/ggerganov/llama.cpp.git /app/llama.cpp && \
23
- cd /app/llama.cpp && \
24
- mkdir -p build && cd build && \
25
- cmake .. -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_SERVER=OFF -DLLAMA_CURL=OFF && \
26
- cmake --build . --config Release
27
 
28
- # Install Python dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
31
- # Ensure /app/models exists and is writable
32
  RUN mkdir -p /app/models && chmod -R 777 /app/models
33
 
34
  # Expose FastAPI port
 
1
+ # Use official Python image
2
+ FROM python:3.10
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  wget \
8
  build-essential \
 
9
  libopenblas-dev \
10
  libcurl4-openssl-dev \
11
  curl \
 
17
  # Copy all project files
18
  COPY . .
19
 
20
+ # Download and install llama-cpp-python prebuilt wheel from Hugging Face Dataset
21
+ RUN wget https://huggingface.co/datasets/Kalpokoch/wheel-llama/resolve/main/llama_cpp_python-0.3.13-cp311-cp311-linux_x86_64.whl -O llama_cpp_python.whl && \
22
+ pip install llama_cpp_python.whl && \
23
+ rm llama_cpp_python.whl
 
 
24
 
25
+ # Install remaining Python dependencies
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
+ # Ensure /app/models exists and is writable
29
  RUN mkdir -p /app/models && chmod -R 777 /app/models
30
 
31
  # Expose FastAPI port