feat: add --resume flag to decouple weight loading from training resumption

- Add --resume bool flag to train.py CLI
- --param_path always loads weights only by default
- --resume restores epoch, consumed_samples, optimizer & scheduler
- Checkpoint.load() now preserves full meta dict
- Update test_early_stopping to use new param_path/resume API
This commit is contained in:
2026-07-16 14:23:23 +08:00
parent b14f301730
commit 84ed2327f5
5 changed files with 44 additions and 25 deletions
+1 -1
View File
@@ -2,7 +2,6 @@
import io
import json
import os
import time
from dataclasses import dataclass, field
from pathlib import Path
@@ -178,6 +177,7 @@ class Checkpoint:
epoch=meta.get("epoch", 0),
consumed_samples=meta.get("consumed_samples", 0),
extra=extra,
meta=meta,
config=config,
)