File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 44summary: This is training code with notes for fine-tuning pre-trained GPT-2 model with LoRA.
55---
66
7- # Finetune GPT-2 with [LoRA](index.html)
7+ # Finetune [ GPT-2](gpt2.html) with [LoRA](index.html)
88
99Here's a Colab notebook for training a feedback transformer on Tiny Shakespeare dataset.
1010
@@ -50,10 +50,15 @@ class Trainer(BaseConfigs):
5050
5151 # Dataset
5252 text : TensorDataset = "tiny_shakespeare"
53+ # Huggingface tokenizer
5354 tokenizer = AutoTokenizer .from_pretrained ("gpt2" )
55+ # [GPT2 model](gpt2.html)
5456 model : GPTModel
57+ # Optimizer
5558 optimizer : torch .optim .Adam
59+ # Cross entropy loss
5660 loss_func = torch .nn .CrossEntropyLoss ()
61+ # Dataloader
5762 data_loader : DataLoader
5863
5964 def _load_pretrained_weights (self ):
@@ -111,7 +116,7 @@ def initialize(self):
111116 """
112117 ### Initialize the model, optimizer and dataloader
113118 """
114- # Initialize the model
119+ # Initialize the [GPT2 model](gpt2.html)
115120 self .model = GPTModel (
116121 layer_norm_epsilon = self .layer_norm_epsilon ,
117122 d_model = self .d_model ,
You can’t perform that action at this time.
0 commit comments