Hello, I am trying to fine-tune the T5 model by hand through PyTorch. I was hoping to extract the logits from the model output, however The output is of class Seq2SeqModelOutput and does not contain a logits paramater.
What it has is: last_hidden_state, past_key_values, decoder_hidden_states, decoder_attentions, cross_attentions, encoder_last_hidden_state, encoder_hidden_states, encoder_attentions.
Is there anyway for me to extract the logits from one of these parameters?
Here is the code that I am running
import torch
dummy_test = 'Hello World'
input_ids = tokenizer(dummy_test, truncation=False).input_ids
input = input_ids
input_decoded = tokenizer.decode(input, truncation=False)
label = input_ids[1:]
label_decoded = tokenizer.decode(label, truncation=False)
input_tensored = tokenizer(input_decoded, return_tensors='pt', padding=True, truncation=True).input_ids
label_tensored = tokenizer(label_decoded, return_tensors='pt', padding=True, truncation=True).input_ids
outputs = model(input_ids=input_tensored, decoder_input_ids=input_tensored)