This learning project implements a GPT language model using Apple's MLX library, following Andrej Karpathy's Let's build GPT video. |
---|
I tried to stay as close as possible to the original material, so that it's easy to follow.
I recommend watching the walkthrough if you haven't yet!
# Setup the environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
At the moment the command below trains and runs the model straight away.
It will also download and cache the data if needed.
python bigram.py
Validation Roughly comparing the results in the video with my results as validation.
Video | MLX |
---|---|
Both converge to a similar value (Please ignore the formatting issues)
Coming soon...
You can inspect the experimental notebook I created while following the video at experiment.ipynb. More understandable if you follow the video.
Tested on Macbook Air M1.
- Apple's MLX
- requests
- Tiny Shakespeare Dataset
- (Optional) jupyter