hf_train_job: uninstall hf_xet before upload to avoid Xet progress-reporter crash
Browse files- scripts/hf_train_job.py +11 -3
scripts/hf_train_job.py
CHANGED
|
@@ -13,9 +13,9 @@ from pathlib import Path
|
|
| 13 |
# workspace, avoiding stale/cached model-volume mounts.
|
| 14 |
|
| 15 |
TOKEN = os.environ.get("HF_TOKEN")
|
| 16 |
-
# Disable Xet
|
| 17 |
-
#
|
| 18 |
-
os.environ
|
| 19 |
|
| 20 |
WORKSPACE = Path("/workspace")
|
| 21 |
SOURCE_DIR = WORKSPACE / "pino-fresh"
|
|
@@ -190,6 +190,14 @@ if TOKEN and checkpoint_path and Path(checkpoint_path).exists():
|
|
| 190 |
repo_id = "mattbitzesty/pino-pimt-checkpoint"
|
| 191 |
_log(f"[HF-JOB] Uploading {checkpoint_path} to {repo_id} as pimt_v4.pt")
|
| 192 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
from huggingface_hub import HfApi, create_repo
|
| 194 |
|
| 195 |
create_repo(repo_id, private=True, token=TOKEN, exist_ok=True)
|
|
|
|
| 13 |
# workspace, avoiding stale/cached model-volume mounts.
|
| 14 |
|
| 15 |
TOKEN = os.environ.get("HF_TOKEN")
|
| 16 |
+
# Disable Xet to avoid a hf_xet/huggingface_hub progress-reporter bug that
|
| 17 |
+
# crashes large-file uploads in the HF Jobs image.
|
| 18 |
+
os.environ["HF_HUB_ENABLE_XET"] = "0"
|
| 19 |
|
| 20 |
WORKSPACE = Path("/workspace")
|
| 21 |
SOURCE_DIR = WORKSPACE / "pino-fresh"
|
|
|
|
| 190 |
repo_id = "mattbitzesty/pino-pimt-checkpoint"
|
| 191 |
_log(f"[HF-JOB] Uploading {checkpoint_path} to {repo_id} as pimt_v4.pt")
|
| 192 |
try:
|
| 193 |
+
# Uninstall hf_xet to force the legacy HTTP upload path and avoid a
|
| 194 |
+
# progress-reporter crash on large files.
|
| 195 |
+
subprocess.check_call(
|
| 196 |
+
[sys.executable, "-m", "pip", "uninstall", "-y", "hf_xet"],
|
| 197 |
+
stdout=subprocess.DEVNULL,
|
| 198 |
+
stderr=subprocess.DEVNULL,
|
| 199 |
+
)
|
| 200 |
+
_log("[HF-JOB] Uninstalled hf_xet; upload will use legacy HTTP path")
|
| 201 |
from huggingface_hub import HfApi, create_repo
|
| 202 |
|
| 203 |
create_repo(repo_id, private=True, token=TOKEN, exist_ok=True)
|