Spaces:
Runtime error
Runtime error
# Use a lightweight Python base image | |
FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Copy requirements.txt | |
COPY requirements.txt . | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY . . | |
# Set environment variables for Hugging Face cache | |
ENV HF_HOME=/app/cache | |
ENV TRANSFORMERS_CACHE=/app/cache | |
# Set to 1 if using quantization and GPU is available | |
ENV USE_QUANTIZATION=0 | |
# Expose port for FastAPI | |
EXPOSE 8000 | |
# Run the FastAPI app with uvicorn (updated to use app.py) | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] |