Solved by BramVanroy in post #4 
              
              
                The class seems pointless because it doesn’t add functionality on top of T5 as currently written. You could have just used T5 as-is. save_pretrained is part of HF subclassed models, not of PyTorch’s nn.Module’s. 
Either don’t use this class and just finetune the given T5 model. Or instead of subclas…