Spaces:
Sleeping
Sleeping
pnorlander Claude Opus 4.6 commited on
Commit ·
a27b6ba
1
Parent(s): 38571b5
Fix worker timeout and tokenizer fork issues
Browse files- Set TOKENIZERS_PARALLELISM=false to prevent fork deadlocks
- Increase gunicorn timeout to 600s for heavy model inference
- Use /dev/shm for worker heartbeat (avoids container filesystem issues)
- Single thread to minimize memory usage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Dockerfile +4 -1
Dockerfile
CHANGED
|
@@ -16,7 +16,10 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 16 |
COPY app.py .
|
| 17 |
COPY index.html .
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# HuggingFace Spaces runs on port 7860
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "
|
|
|
|
| 16 |
COPY app.py .
|
| 17 |
COPY index.html .
|
| 18 |
|
| 19 |
+
# Avoid tokenizer fork deadlocks
|
| 20 |
+
ENV TOKENIZERS_PARALLELISM=false
|
| 21 |
+
|
| 22 |
# HuggingFace Spaces runs on port 7860
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "--workers", "1", "--threads", "1", "--preload", "--worker-tmp-dir", "/dev/shm", "--access-logfile", "-", "--error-logfile", "-", "app:app"]
|