train: state which tokenizer files shipped with the export
Browse files- train/train_ounce100m.py +11 -0
train/train_ounce100m.py
CHANGED
|
@@ -330,6 +330,17 @@ def main():
|
|
| 330 |
|
| 331 |
out = os.path.join(args.out, "final")
|
| 332 |
tr.save_model(out)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
SD.save_cursor(out, SD.cursor_dict(args.seq_len, samples, args.data_seed, fingerprint))
|
| 334 |
json.dump({"step": step, "tokens_consumed": consumed, "seconds": round(elapsed, 1),
|
| 335 |
"params": pc, "fingerprint": fingerprint, "final_loss": final_loss,
|
|
|
|
| 330 |
|
| 331 |
out = os.path.join(args.out, "final")
|
| 332 |
tr.save_model(out)
|
| 333 |
+
# The tokenizer travels with the run so `final/` is loadable by AutoTokenizer on its own (§8). If it
|
| 334 |
+
# is not in the mix root, say so in the summary instead of skipping quietly and being surprised later.
|
| 335 |
+
shipped = []
|
| 336 |
+
import shutil as _sh
|
| 337 |
+
for fn in ("tokenizer.json", "tokenizer_config.json", "special_tokens_map.json", "vocab.json",
|
| 338 |
+
"merges.txt"):
|
| 339 |
+
src = os.path.join(args.root, fn)
|
| 340 |
+
if os.path.exists(src):
|
| 341 |
+
_sh.copy(src, out)
|
| 342 |
+
shipped.append(fn)
|
| 343 |
+
say(f"tokenizer files shipped with the export: {shipped or 'NONE -- Phase 5 must add them'}")
|
| 344 |
SD.save_cursor(out, SD.cursor_dict(args.seq_len, samples, args.data_seed, fingerprint))
|
| 345 |
json.dump({"step": step, "tokens_consumed": consumed, "seconds": round(elapsed, 1),
|
| 346 |
"params": pc, "fingerprint": fingerprint, "final_loss": final_loss,
|