Spaces:
Running
Running
File size: 675 Bytes
add75cd 30113b5 add75cd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
FROM python:3.9
WORKDIR /app
# Create a writable cache directory
RUN mkdir -p /app/.cache && chmod 777 /app/.cache
# Set environment variables for cache
ENV HF_HOME=/app/.cache
ENV TRANSFORMERS_CACHE=/app/.cache/transformers
ENV SENTENCE_TRANSFORMERS_HOME=/app/.cache/sentence_transformers
ENV TORCH_HOME=/app/.cache/torch
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Download NLTK data
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"
# Copy all files
COPY . .
# Create data directory if needed
RUN mkdir -p data
# Expose port
EXPOSE 7860
# Run Flask app
CMD ["python", "run.py"] |