Andrew McCracken
Claude
commited on
Commit
·
b721fc6
1
Parent(s):
3b792bc
Fix Hugging Face cache permissions
Browse files- Set HF_HOME, TRANSFORMERS_CACHE, HF_HUB_CACHE to /data/huggingface
- Create all required cache directories with proper permissions
- Fixes RuntimeError: Data processing error: I/O error: Permission denied
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -9,8 +9,14 @@ ENV MODEL_FILENAME=phi4-mini-instruct-Q4_K_M.gguf
|
|
| 9 |
ENV USE_RAG=true
|
| 10 |
ENV CACHE_ENABLED=true
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
EXPOSE 8000
|
| 16 |
CMD ["python", "main.py"]
|
|
|
|
| 9 |
ENV USE_RAG=true
|
| 10 |
ENV CACHE_ENABLED=true
|
| 11 |
|
| 12 |
+
# Set Hugging Face cache to /data for persistence and write permissions
|
| 13 |
+
ENV HF_HOME=/data/huggingface
|
| 14 |
+
ENV TRANSFORMERS_CACHE=/data/huggingface/transformers
|
| 15 |
+
ENV HF_HUB_CACHE=/data/huggingface/hub
|
| 16 |
+
|
| 17 |
+
# Ensure all required directories exist and are writable
|
| 18 |
+
RUN mkdir -p /data /app/models /data/huggingface/hub /data/huggingface/transformers && \
|
| 19 |
+
chmod -R 777 /data /app/models
|
| 20 |
|
| 21 |
EXPOSE 8000
|
| 22 |
CMD ["python", "main.py"]
|