mirror of
https://github.com/RYDE-WORK/autoresearch.git
synced 2026-07-22 04:11:44 +08:00
Guard against infinite loop when no training shards exist, fix README typo
This commit is contained in:
commit
c2450add72
@ -8,7 +8,7 @@ The idea: give an AI agent a small but real LLM training setup and let it experi
|
|||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
The repo is deliberately kept small and only really has a three files that matter:
|
The repo is deliberately kept small and only really has three files that matter:
|
||||||
|
|
||||||
- **`prepare.py`** — fixed constants, one-time data prep (downloads training data, trains a BPE tokenizer), and runtime utilities (dataloader, evaluation). Not modified.
|
- **`prepare.py`** — fixed constants, one-time data prep (downloads training data, trains a BPE tokenizer), and runtime utilities (dataloader, evaluation). Not modified.
|
||||||
- **`train.py`** — the single file the agent edits. Contains the full GPT model, optimizer (Muon + AdamW), and training loop. Everything is fair game: architecture, hyperparameters, optimizer, batch size, etc. **This file is edited and iterated on by the agent**.
|
- **`train.py`** — the single file the agent edits. Contains the full GPT model, optimizer (Muon + AdamW), and training loop. Everything is fair game: architecture, hyperparameters, optimizer, batch size, etc. **This file is edited and iterated on by the agent**.
|
||||||
|
|||||||
@ -258,6 +258,7 @@ def _document_batches(split, tokenizer_batch_size=128):
|
|||||||
val_path = os.path.join(DATA_DIR, VAL_FILENAME)
|
val_path = os.path.join(DATA_DIR, VAL_FILENAME)
|
||||||
if split == "train":
|
if split == "train":
|
||||||
parquet_paths = [p for p in parquet_paths if p != val_path]
|
parquet_paths = [p for p in parquet_paths if p != val_path]
|
||||||
|
assert len(parquet_paths) > 0, "No training shards found."
|
||||||
else:
|
else:
|
||||||
parquet_paths = [val_path]
|
parquet_paths = [val_path]
|
||||||
epoch = 1
|
epoch = 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user