mattbitzesty commited on
Commit
048b196
·
unverified ·
1 Parent(s): e19a381

hf_train_job: uninstall hf_xet before upload to avoid Xet progress-reporter crash

Browse files
Files changed (1) hide show
  1. 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 storage for large-file uploads; fall back to LFS to avoid a
17
- # huggingface_hub/hf-xet progress-reporter bug observed in the HF Jobs image.
18
- os.environ.setdefault("HF_HUB_ENABLE_XET", "false")
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)