Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -0
Dockerfile
CHANGED
|
@@ -26,6 +26,12 @@ RUN mkdir -p $HF_HOME
|
|
| 26 |
ARG HF_TOKEN
|
| 27 |
ENV HF_TOKEN=${HF_TOKEN}
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Pre-download models (handle errors gracefully)
|
| 30 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
| 31 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis', use_auth_token='$HF_TOKEN')" || echo 'Failed to download model 1'
|
|
|
|
| 26 |
ARG HF_TOKEN
|
| 27 |
ENV HF_TOKEN=${HF_TOKEN}
|
| 28 |
|
| 29 |
+
ENV HF_HOME="/tmp/huggingface_cache"
|
| 30 |
+
ENV HUGGINGFACE_HUB_CACHE="/tmp/huggingface_cache"
|
| 31 |
+
|
| 32 |
+
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
|
| 33 |
+
|
| 34 |
+
|
| 35 |
# Pre-download models (handle errors gracefully)
|
| 36 |
RUN /app/venv/bin/python -c "from transformers import pipeline; \
|
| 37 |
pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis', use_auth_token='$HF_TOKEN')" || echo 'Failed to download model 1'
|