Spaces:
Sleeping
Sleeping
| FROM python:3.10 | |
| WORKDIR /app | |
| # System deps | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python deps | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Pre-download model (IMPORTANT: avoids runtime network issues) | |
| RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \ | |
| AutoTokenizer.from_pretrained('distilgpt2'); \ | |
| AutoModelForCausalLM.from_pretrained('distilgpt2')" | |
| # Copy app | |
| COPY app.py . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |