File size: 719 Bytes
8c21c91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM python:3.10-slim

WORKDIR /app

# Install deps first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Pre-download the model during build so cold starts are instant
# HF caches it at /root/.cache/huggingface
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-mpnet-base-v2')"

# Copy app + artifacts
COPY app.py .
COPY sdg_data.json .
COPY indicator_corpus.pkl .
COPY indicator_embeddings.npy .

# If you have a fine-tuned model, uncomment this:
# COPY finetuned_model/ ./finetuned_model/

# HuggingFace Spaces requires port 7860
EXPOSE 7860

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]