Spaces:
Sleeping
Sleeping
| FROM python:3.9-slim | |
| WORKDIR /code | |
| # Install system deps for some transformers backends (optional) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential git curl && rm -rf /var/lib/apt/lists/* | |
| # Install Python deps | |
| RUN pip install --no-cache-dir --upgrade pip | |
| RUN pip install --no-cache-dir fastapi uvicorn transformers torch accelerate gradio spaces textblob pytz duckduckgo-search wikipedia scikit-learn | |
| # Download TextBlob corpora (lite) | |
| RUN python -m textblob.download_corpora lite | |
| # Pre-download some models to speed up runtime (best-effort) | |
| RUN python -c "from transformers import pipeline; pipeline('zero-shot-classification', model='typeform/distilbert-base-uncased-mnli')" | |
| RUN python -c "from transformers import pipeline; pipeline('text-classification', model='j-hartmann/emotion-english-distilroberta-base')" | |
| COPY . . | |
| RUN chmod -R 755 . | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |