Output from 2 inputs using T5 base model

Hi, below is my python code using t5-base model. I am getting the output as “True” instead of the required output from the inputs. What is wrong in this code? Thanks.

from transformers import T5Tokenizer, T5ForConditionalGeneration

Load the pre-trained T5 model and tokenizer

tokenizer = T5Tokenizer.from_pretrained(‘t5-base’)
model = T5ForConditionalGeneration.from_pretrained(‘t5-base’)

Define the inputs

question = “What is the capital of Spain?”
answer = “Madrid”

Encode the inputs

input_str = “question: {} answer: {}”.format(question, answer)
input_ids = tokenizer.encode(input_str, return_tensors=‘pt’)

Generate the conclusion

output_ids = model.generate(input_ids=input_ids, max_length=128, num_beams=4, early_stopping=True)
output_str = tokenizer.decode(output_ids[0], skip_special_tokens=True)

Print the conclusion