pin: train/train_ounce100m.py (RepoMissing resume branch, disk gate, PHASE4_PREP_ONLY)
Browse files- train/train_ounce100m.py +7 -0
train/train_ounce100m.py
CHANGED
|
@@ -330,6 +330,13 @@ def main():
|
|
| 330 |
listed = sorted(k for k in hubckpt.hub_listing(args.hub_repo, args.hub_repo_type,
|
| 331 |
token=tk)
|
| 332 |
if k.startswith("ckpt/checkpoint-"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
except Exception as e:
|
| 334 |
listed = [f"<listing failed: {type(e).__name__}>"]
|
| 335 |
if listed:
|
|
|
|
| 330 |
listed = sorted(k for k in hubckpt.hub_listing(args.hub_repo, args.hub_repo_type,
|
| 331 |
token=tk)
|
| 332 |
if k.startswith("ckpt/checkpoint-"))
|
| 333 |
+
except hubckpt.RepoMissing:
|
| 334 |
+
# The checkpoint repo has never been created: nothing has ever been pushed, so step 0 is
|
| 335 |
+
# the only correct answer. The first session of the run always takes this branch, and
|
| 336 |
+
# treating a 404 as "listing failed" would refuse it (a generic `except Exception` below
|
| 337 |
+
# makes the list non-empty and the refusal fires).
|
| 338 |
+
say(f"{args.hub_repo} does not exist yet -- nothing has ever been pushed")
|
| 339 |
+
listed = []
|
| 340 |
except Exception as e:
|
| 341 |
listed = [f"<listing failed: {type(e).__name__}>"]
|
| 342 |
if listed:
|