Spaces:
Sleeping
Sleeping
| FROM python:3.12.9-slim-bookworm | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN apt update && apt install -y curl git && rm -rf /var/lib/apt/lists/* | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN mkdir -p /app/logs && chmod -R 777 /app/logs | |
| RUN python -c "from transformers import AutoModelForSeq2SeqLM, AutoTokenizer; \ | |
| model = AutoModelForSeq2SeqLM.from_pretrained('facebook/bart-large-cnn'); \ | |
| tokenizer = AutoTokenizer.from_pretrained('facebook/bart-large-cnn'); \ | |
| model.save_pretrained('/app/models/bart-large-cnn'); \ | |
| tokenizer.save_pretrained('/app/models/bart-large-cnn')" | |
| RUN python -c "from sentence_transformers import SentenceTransformer; \ | |
| SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2').save('/app/models/all-MiniLM-L6-v2')" | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |