FROM python:3.10-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ git \ git-lfs \ build-essential \ && rm -rf /var/lib/apt/lists/* # Initialize git-lfs RUN git lfs install # Install Python packages COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application files COPY . . # Set up Hugging Face cache directory ENV HF_HOME=/app/cache ENV TRANSFORMERS_CACHE=/app/cache ENV HF_HUB_CACHE=/app/cache # Set environment variables for better performance ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512 ENV CUDA_VISIBLE_DEVICES=0,1,2,3 # Expose port for the application EXPOSE 7860 # Run the application CMD ["python", "app.py"]