This is the Python code to build a Generative Pre-trained Transformer (GPT), similar to ChatGPT, but at a much smaller operational scale, trained on the full corpus of Shakespeare's work using PyTorch.
Based on the amazing tutorial by Andrej Karpathy: https://www.youtube.com/watch?v=kCc8FmEb1nY&ab_channel=AndrejKarpathy