SHERWYNLUCIAN commited on
Commit
7066ded
·
verified ·
1 Parent(s): dce0a29

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -1,11 +1,14 @@
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
- # Install pre-built wheels to avoid C++ compilation memory limit (OOMKilled)
5
- RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
6
 
7
  COPY requirements.txt .
8
- RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
 
9
  COPY . .
10
 
11
  # Hugging Face exposes port 7860
 
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
+ # Install build tools for llama-cpp-python (C++ compiler)
5
+ RUN apt-get update && apt-get install -y g++ build-essential cmake curl && rm -rf /var/lib/apt/lists/*
6
 
7
  COPY requirements.txt .
8
+ # Force single-threaded compilation to prevent OOMKilled on Hugging Face Spaces
9
+ ENV CMAKE_BUILD_PARALLEL_LEVEL=1
10
+ ENV MAKEFLAGS="-j1"
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
  COPY . .
13
 
14
  # Hugging Face exposes port 7860