Spaces:
Runtime error
Runtime error
File size: 1,305 Bytes
7fb74eb d506599 7fb74eb d00ea4e d506599 d00ea4e d506599 7fb74eb d506599 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.10-slim-buster
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container at /app
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
# Also, download textblob corpora
RUN pip install --no-cache-dir -r requirements.txt \
&& python -m textblob.download_corpora
# --- UPDATED HUGGING FACE MODELS PRE-DOWNLOAD ---
# Sentiment Model (already correct)
RUN python -c "from transformers import pipeline; pipeline('sentiment-analysis', model='cardiffnlp/twitter-roberta-base-sentiment-latest')"
# Sarcasm/Irony Model (CORRECTED)
RUN python -c "from transformers import AutoTokenizer, AutoModelForSequenceClassification; tokenizer = AutoTokenizer.from_pretrained('cardiffnlp/twitter-roberta-base-irony'); model = AutoModelForSequenceClassification.from_pretrained('cardiffnlp/twitter-roberta-base-irony')"
# --- END OF UPDATED LINES ---
# Copy the entire project directory into the container at /app
COPY . .
# Expose the port that Streamlit runs on
EXPOSE 8501
# Define the command to run the Streamlit application
# Streamlit runs on 0.0.0.0 by default in Docker
CMD ["streamlit", "run", "frontend/app.py", "--server.port=8501", "--server.address=0.0.0.0"] |