tusarway commited on
Commit
f392a20
·
verified ·
1 Parent(s): 7bf4f43
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # System build deps for llama-cpp-python (CPU + OpenBLAS for speed)
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ cmake \
9
+ libopenblas-dev \
10
+ curl \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install Python deps — compile llama-cpp-python with OpenBLAS
14
+ COPY requirements.txt .
15
+ RUN CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS" \
16
+ FORCE_CMAKE=1 \
17
+ pip install --no-cache-dir -r requirements.txt
18
+
19
+ COPY app.py .
20
+
21
+ # HuggingFace Spaces expects port 7860
22
+ EXPOSE 7860
23
+
24
+ # Set SPACE_URL at runtime via HF Space secrets/env vars
25
+ ENV SPACE_URL=""
26
+ ENV N_CTX="8192"
27
+ ENV N_THREADS="2"
28
+
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]