Skip to content

Commit

Permalink
Add train and run README
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaczan committed Jun 22, 2024
1 parent eaef1bc commit b8e02a1
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,56 @@
# gpt

Generative Pre-trained Transformer in PyTorch
Generative Pre-trained Transformer in PyTorch from scratch

<figure>
<div align="center">
<a href="https://anitamaczan.pl/#problem_n_cial" target="_blank">
<img src="https://anitamaczan.pl/problem_n_cial.jpg" width="250" alt="'N-body problem' by Anita Maczan, Acrylic on canvas, 80x100, 2024">
<img src="https://anitamaczan.pl/problem_n_cial.jpg" width="200" alt="'N-body problem' by Anita Maczan, Acrylic on canvas, 80x100, 2024">
</a>
</div>
<figcaption><div align="center" style="font-family: monospace; font-size: 0.75rem">"N-body problem" by Anita Maczan, Acrylic on canvas, 80x100, 2024</div></figcaption>
</p>
</figure>

## Train

### CLI
```sh
python src/train.py
```

Options:
```sh
--batch_size 64
--num-epochs 100
--lr 0.0001
--from-checkpoint checkpoint_path.pth
```

Model is checkpointed after each epoch and stored in `checkpoints/` directory


### Code
```py
from train import train

train()
```

## Run

### CLI

```sh
python src/run.py --from-checkpoint checkpoint_path.pth
```

### Code
```py
from run import run

run(model_path="checkpoint_path.pth")
```

## License

GPL v3
Expand Down

0 comments on commit b8e02a1

Please sign in to comment.