Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
@@ -19,10 +19,13 @@ 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 |
-
# Ensure the model cache directory exists
|
23 |
-
RUN mkdir -p $HF_HOME
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
# Pre-download models (handle errors gracefully)
|
26 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
27 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis')" || echo "Failed to download model 1"
|
28 |
|
|
|
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 |
+
# Ensure the model cache directory exists and is writable
|
23 |
+
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
|
24 |
+
|
25 |
+
# Pre-download models
|
26 |
+
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
27 |
+
pipeline('sentiment-analysis', model='johndoee/sentiment')" || echo "Failed to download custom model"
|
28 |
|
|
|
29 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
30 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis')" || echo "Failed to download model 1"
|
31 |
|