Views
No views yet
| Piece | File |
|---|---|
| Tokenizer | built into train.py (character-level — each unique character is one token) |
| Embedding layer, transformer blocks, output head | model.py |
| Training loop (data → loss → backprop → updated weights) | train.py |
| The trained model itself (architecture config + weights + vocab) | checkpoint.pt, created when you run train.py |
| Generation / inference | generate.py |
pip install torchpython train.pycheckpoint.pt.train.py and lower
max_steps to something like 300 — you'll see it run in under a minute,
though the output will be closer to gibberish since it hasn't trained long
enough to learn structure.1python generate.py
2python generate.py "ROMEO:" 500n_layer / n_head / n_embd in CONFIG — make the model bigger or
smaller and watch how it affects both training speed and the quality of
generated text.block_size — how much context (how many previous characters) the model
can see at once.data_file — train it on a book, your own
writing, song lyrics you have rights to, anything — and watch the
generated text take on that style.