Update HF job script for v6: dataset v8, checkpoint pimt_v6.pt, scalar_stats
Browse files- scripts/hf_train_job.py +12 -4
scripts/hf_train_job.py
CHANGED
|
@@ -98,6 +98,14 @@ try:
|
|
| 98 |
token=TOKEN,
|
| 99 |
)
|
| 100 |
_log(f"[HF-JOB] Dataset downloaded to {DATASET_DIR}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
except Exception as exc:
|
| 102 |
_log(f"[HF-JOB] Download failed: {exc}")
|
| 103 |
traceback.print_exc()
|
|
@@ -155,7 +163,7 @@ except Exception as exc:
|
|
| 155 |
_log("[HF-JOB] Imports completed")
|
| 156 |
|
| 157 |
# Resolve data path.
|
| 158 |
-
data_path = DATASET_DIR / "
|
| 159 |
_log(f"[HF-JOB] Final data path: {data_path} (exists={data_path.exists()})")
|
| 160 |
|
| 161 |
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
|
|
@@ -173,7 +181,7 @@ sys.argv = [
|
|
| 173 |
"--log-dir", str(LOG_DIR),
|
| 174 |
]
|
| 175 |
|
| 176 |
-
_log("🚀 HF Job: starting PINO 5-epoch
|
| 177 |
_log(f" Device: {'cuda' if torch.cuda.is_available() else 'cpu'}")
|
| 178 |
_log(f" Args: {' '.join(sys.argv[1:])}")
|
| 179 |
|
|
@@ -189,7 +197,7 @@ _log(f"✅ Training complete. Checkpoint: {checkpoint_path}")
|
|
| 189 |
|
| 190 |
if TOKEN and checkpoint_path and Path(checkpoint_path).exists():
|
| 191 |
repo_id = "mattbitzesty/pino-pimt-checkpoint"
|
| 192 |
-
_log(f"[HF-JOB] Uploading {checkpoint_path} to {repo_id} as
|
| 193 |
try:
|
| 194 |
# Monkey-patch / bypass Xet to avoid a hf_xet/huggingface_hub bug that
|
| 195 |
# crashes large-file uploads in the HF Jobs image.
|
|
@@ -211,7 +219,7 @@ if TOKEN and checkpoint_path and Path(checkpoint_path).exists():
|
|
| 211 |
create_repo(repo_id, private=True, token=TOKEN, exist_ok=True)
|
| 212 |
HfApi(token=TOKEN).upload_file(
|
| 213 |
path_or_fileobj=str(checkpoint_path),
|
| 214 |
-
path_in_repo="
|
| 215 |
repo_id=repo_id,
|
| 216 |
repo_type="model",
|
| 217 |
)
|
|
|
|
| 98 |
token=TOKEN,
|
| 99 |
)
|
| 100 |
_log(f"[HF-JOB] Dataset downloaded to {DATASET_DIR}")
|
| 101 |
+
|
| 102 |
+
# Copy scalar_stats_v1.json into the source tree's artifacts/ dir
|
| 103 |
+
scalar_stats_src = DATASET_DIR / "scalar_stats_v1.json"
|
| 104 |
+
if scalar_stats_src.exists():
|
| 105 |
+
artifacts_dir = SOURCE_DIR / "artifacts"
|
| 106 |
+
artifacts_dir.mkdir(parents=True, exist_ok=True)
|
| 107 |
+
shutil.copy2(scalar_stats_src, artifacts_dir / "scalar_stats_v1.json")
|
| 108 |
+
_log(f"[HF-JOB] Copied scalar_stats_v1.json to {artifacts_dir}")
|
| 109 |
except Exception as exc:
|
| 110 |
_log(f"[HF-JOB] Download failed: {exc}")
|
| 111 |
traceback.print_exc()
|
|
|
|
| 163 |
_log("[HF-JOB] Imports completed")
|
| 164 |
|
| 165 |
# Resolve data path.
|
| 166 |
+
data_path = DATASET_DIR / "empirical_dataset_v8.jsonl"
|
| 167 |
_log(f"[HF-JOB] Final data path: {data_path} (exists={data_path.exists()})")
|
| 168 |
|
| 169 |
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 181 |
"--log-dir", str(LOG_DIR),
|
| 182 |
]
|
| 183 |
|
| 184 |
+
_log("🚀 HF Job: starting PINO 5-epoch v6 concentration-aware convergence pass")
|
| 185 |
_log(f" Device: {'cuda' if torch.cuda.is_available() else 'cpu'}")
|
| 186 |
_log(f" Args: {' '.join(sys.argv[1:])}")
|
| 187 |
|
|
|
|
| 197 |
|
| 198 |
if TOKEN and checkpoint_path and Path(checkpoint_path).exists():
|
| 199 |
repo_id = "mattbitzesty/pino-pimt-checkpoint"
|
| 200 |
+
_log(f"[HF-JOB] Uploading {checkpoint_path} to {repo_id} as pimt_v6.pt")
|
| 201 |
try:
|
| 202 |
# Monkey-patch / bypass Xet to avoid a hf_xet/huggingface_hub bug that
|
| 203 |
# crashes large-file uploads in the HF Jobs image.
|
|
|
|
| 219 |
create_repo(repo_id, private=True, token=TOKEN, exist_ok=True)
|
| 220 |
HfApi(token=TOKEN).upload_file(
|
| 221 |
path_or_fileobj=str(checkpoint_path),
|
| 222 |
+
path_in_repo="pimt_v6.pt",
|
| 223 |
repo_id=repo_id,
|
| 224 |
repo_type="model",
|
| 225 |
)
|