Set USER + compile cache dirs so torch.compile can run as uid 1000
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
|
@@ -27,7 +27,12 @@ COPY app.py .
|
|
| 27 |
# bf16 weights on every cold start.
|
| 28 |
ENV HF_XET_HIGH_PERFORMANCE=1 \
|
| 29 |
PYTHONUNBUFFERED=1 \
|
| 30 |
-
HF_HOME=/tmp/hf_cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
EXPOSE 7860
|
| 33 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 27 |
# bf16 weights on every cold start.
|
| 28 |
ENV HF_XET_HIGH_PERFORMANCE=1 \
|
| 29 |
PYTHONUNBUFFERED=1 \
|
| 30 |
+
HF_HOME=/tmp/hf_cache \
|
| 31 |
+
USER=aurora \
|
| 32 |
+
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor \
|
| 33 |
+
TRITON_CACHE_DIR=/tmp/triton
|
| 34 |
+
# USER: the Space runs as uid 1000 with no passwd entry, and torch.compile's
|
| 35 |
+
# cache path calls getpass.getuser(), which dies on getpwuid() unless USER is set.
|
| 36 |
|
| 37 |
EXPOSE 7860
|
| 38 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|