teenypt is a minimal GPT-2 implementation built with tinygrad.
- Pure Tinygrad implementation (no PyTorch or TensorFlow runtime)
- Supports temperature-based and greedy sampling
- Compact and easy to read (~200 lines)
Run from the command line:
$ python teenypt/teenypt.py --prompt "Once upon a time" --temperature 0.7
, I had been a member of a group that had been working on a project called "The Cool Girl." I had been reading about the various meanings of the word "cool" in the past.
Talk is cheap, improve teenypt.
.png)

