Download Dockerfile from dev2004v/autotldr: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/spaces/dev2004v/autotldr/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/dev2004v/autotldr/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/dev2004v/autotldr/resolve/main/Dockerfile
617 Bytes
| # Use Python slim image | |
| FROM python:3.10-slim | |
| # Set environment variable to avoid /.cache permission error | |
| ENV TRANSFORMERS_CACHE=/tmp/hf_cache | |
| # Set working directory | |
| WORKDIR /code | |
| # Install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Pre-download Hugging Face model (optional but recommended) | |
| RUN python -c "from transformers import pipeline; pipeline('summarization', model='philschmid/bart-large-cnn-samsum')" | |
| # Copy app code | |
| COPY ./app ./app | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run FastAPI app | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |