its just a class in pytorch.



 BramVanroy:

What is T5Finetuner? That is not a Transformers model.


class T5FineTuner(nn.Module):
    def __init__(self,model,tokenizer):
        super(T5FineTuner, self).__init__()
        self.t5 = model
        self.tokenizer = tokenizer
        
    def forward(self,input_ids, attention_mask=None, decoder_input_ids=None, decoder_attention_mask=None, lm_labels=None):
        outputs = self.t5(
            input_ids=input_ids,
            attention_mask=attention_mask,
            decoder_input_ids = decoder_input_ids,
            decoder_attention_mask=decoder_attention_mask,
            labels=lm_labels,
        )
        return outputs

Model is created using this class!