FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt \ --extra-index-url https://download.pytorch.org/whl/cpu COPY app.py . # Writable cache for the model download (Spaces run as non-root uid 1000) ENV HF_HOME=/tmp/hf EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]