Spaces:
Running
Running
fix: resolve sync timeout with longer timeout and hf_transfer
Browse filesDefault HF Hub read timeout (10s) causes failures on large state uploads.
Set HF_HUB_DOWNLOAD_TIMEOUT=300s and enable hf_transfer for faster
multipart transfers. Install hf_transfer package in Dockerfile.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Dockerfile +1 -1
- hermes-sync.py +2 -0
Dockerfile
CHANGED
|
@@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 28 |
fonts-liberation \
|
| 29 |
fonts-noto-color-emoji \
|
| 30 |
&& rm -rf /var/lib/apt/lists/* \
|
| 31 |
-
&& uv pip install --python /opt/hermes/.venv/bin/python --no-cache-dir huggingface_hub
|
| 32 |
|
| 33 |
COPY --chown=hermes:hermes start.sh /opt/huggingmes/start.sh
|
| 34 |
COPY --chown=hermes:hermes health-server.js /opt/huggingmes/health-server.js
|
|
|
|
| 28 |
fonts-liberation \
|
| 29 |
fonts-noto-color-emoji \
|
| 30 |
&& rm -rf /var/lib/apt/lists/* \
|
| 31 |
+
&& uv pip install --python /opt/hermes/.venv/bin/python --no-cache-dir huggingface_hub hf_transfer
|
| 32 |
|
| 33 |
COPY --chown=hermes:hermes start.sh /opt/huggingmes/start.sh
|
| 34 |
COPY --chown=hermes:hermes health-server.js /opt/huggingmes/health-server.js
|
hermes-sync.py
CHANGED
|
@@ -17,6 +17,8 @@ from pathlib import Path
|
|
| 17 |
|
| 18 |
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
|
| 19 |
os.environ.setdefault("HF_HUB_VERBOSITY", "error")
|
|
|
|
|
|
|
| 20 |
|
| 21 |
from huggingface_hub import HfApi, snapshot_download, upload_folder
|
| 22 |
from huggingface_hub.errors import HfHubHTTPError, RepositoryNotFoundError
|
|
|
|
| 17 |
|
| 18 |
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
|
| 19 |
os.environ.setdefault("HF_HUB_VERBOSITY", "error")
|
| 20 |
+
os.environ.setdefault("HF_HUB_DOWNLOAD_TIMEOUT", "300") # 5 min — default 10s causes timeout on large state
|
| 21 |
+
os.environ.setdefault("HF_HUB_ENABLE_HF_TRANSFER", "1") # faster multipart upload/download
|
| 22 |
|
| 23 |
from huggingface_hub import HfApi, snapshot_download, upload_folder
|
| 24 |
from huggingface_hub.errors import HfHubHTTPError, RepositoryNotFoundError
|