File size: 774 Bytes
77b1831
 
bacc9d2
 
 
 
6182c59
77b1831
6182c59
77b1831
bacc9d2
6182c59
 
9fccefa
77b1831
 
bacc9d2
6182c59
77b1831
bacc9d2
 
 
6182c59
77b1831
 
6182c59
9fccefa
bacc9d2
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
27
28
29
FROM python:3.11-slim

# --- Hugging Face caches to a writable path inside the container ---
ENV HF_HOME=/app/hf_cache \
    TRANSFORMERS_CACHE=/app/hf_cache \
    HF_DATASETS_CACHE=/app/hf_cache \
    HF_HUB_ENABLE_HF_TRANSFER=1 \
    PIP_NO_CACHE_DIR=1 \
    PYTHONUNBUFFERED=1

# Model id can be overridden at build or runtime
ARG MODEL_ID=ethnmcl/checkin-lora-gpt2
ENV MODEL_ID=${MODEL_ID}

WORKDIR /app
COPY requirements.txt /app/requirements.txt

RUN pip install --upgrade pip && pip install -r requirements.txt

# Ensure the cache directory exists and is writable (adjust ownership for your base image/user policy)
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache

COPY . /app

EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]