akshat57 commited on
Commit
e8fea61
·
verified ·
1 Parent(s): f8dbfef

Upload custom_model.py

Browse files
Files changed (1) hide show
  1. custom_model.py +14 -0
custom_model.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import GPT2LMHeadModel
2
+
3
+ class CustomGPT2Model(GPT2LMHeadModel):
4
+ def __init__(self, config):
5
+ super().__init__(config)
6
+
7
+ def forward(self, input_ids=None, attention_mask=None, **kwargs):
8
+ # Custom forward logic
9
+ outputs = super().forward(input_ids=input_ids, attention_mask=attention_mask, **kwargs)
10
+ # Modify the outputs as needed
11
+
12
+ print('USING CUSTOM WRAPPER')
13
+ return outputs
14
+