Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
# Install dependencies | |
RUN pip install --upgrade pip | |
COPY requirements.txt . | |
RUN pip install -r requirements.txt | |
# Create writable Hugging Face cache | |
RUN mkdir -p /tmp/hf-cache | |
# Preload the model to avoid runtime LFS issues | |
RUN python -c "import os; os.environ['HF_HOME'] = '/tmp/hf-cache'; from transformers import AutoTokenizer, AutoModelForSequenceClassification; AutoTokenizer.from_pretrained('cybersectony/phishing-email-detection-distilbert_v2.4.1'); AutoModelForSequenceClassification.from_pretrained('cybersectony/phishing-email-detection-distilbert_v2.4.1')" | |
# Copy app files | |
COPY main.py . | |
# Run the FastAPI app | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |