Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +5 -0
Dockerfile
CHANGED
@@ -19,6 +19,11 @@ RUN python -m venv /app/venv && \
|
|
19 |
/app/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
20 |
/app/venv/bin/pip install --no-cache-dir -r requirements.txt
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
23 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis')" || echo "Failed to download model 1"
|
24 |
|
|
|
19 |
/app/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
20 |
/app/venv/bin/pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
+
|
23 |
+
# Ensure the model cache directory exists
|
24 |
+
RUN mkdir -p $HF_HOME
|
25 |
+
|
26 |
+
# Pre-download models (handle errors gracefully)
|
27 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
28 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis')" || echo "Failed to download model 1"
|
29 |
|