From 39e7ffeec21c5ffb2767f0a87de1648175c1718e Mon Sep 17 00:00:00 2001 From: Yunqi Date: Wed, 29 Apr 2026 14:07:50 -0400 Subject: [PATCH 1/4] changes --- mingpt/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mingpt/model.py b/mingpt/model.py index 83ee22d..4d2705f 100644 --- a/mingpt/model.py +++ b/mingpt/model.py @@ -8,6 +8,7 @@ https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt2/modeling_gpt2.py """ +## changing import math import torch From 4c4ee91fa520c45e32bbf64ead1e368c8adc8458 Mon Sep 17 00:00:00 2001 From: Yunqi Date: Wed, 29 Apr 2026 14:13:29 -0400 Subject: [PATCH 2/4] change for main --- mingpt/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingpt/model.py b/mingpt/model.py index 4d2705f..deb7329 100644 --- a/mingpt/model.py +++ b/mingpt/model.py @@ -8,7 +8,7 @@ https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt2/modeling_gpt2.py """ -## changing +## changing for main branch import math import torch From b6a7728b0b108529b1e45fbb19eb347b3b3c98be Mon Sep 17 00:00:00 2001 From: Yunqi Date: Wed, 29 Apr 2026 14:15:04 -0400 Subject: [PATCH 3/4] change for merge branch --- mingpt/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingpt/model.py b/mingpt/model.py index 4d2705f..9c3cdc4 100644 --- a/mingpt/model.py +++ b/mingpt/model.py @@ -8,7 +8,7 @@ https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt2/modeling_gpt2.py """ -## changing +## changing for merge branch import math import torch From 047c004f59fbaccda92a45991990d7b80d317ffe Mon Sep 17 00:00:00 2001 From: Yunqi Date: Wed, 29 Apr 2026 14:33:17 -0400 Subject: [PATCH 4/4] Add a small lab change in readme for PR exercise --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9debd17..e78e3ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # minGPT + ![mingpt](mingpt.jpg) A PyTorch re-implementation of [GPT](https://github.com/openai/gpt-2), both training and inference. minGPT tries to be small, clean, interpretable and educational, as most of the currently available GPT model implementations can a bit sprawling. GPT is not a complicated model and this implementation is appropriately about 300 lines of code (see [mingpt/model.py](mingpt/model.py)). All that's going on is that a sequence of indices feeds into a [Transformer](https://arxiv.org/abs/1706.03762), and a probability distribution over the next index in the sequence comes out. The majority of the complexity is just being clever with batching (both across examples and over sequence length) for efficiency.