while concatenating the predicted next word to the output, you have included axis argument twice?
you don’t need to specify axis argument for the concatenated predicted next word and output, only for the tokenized answer to the next word.
Also the specified value for axis 0 and 1 would be incorrect as we are trying to predict next word and not previous word or the word itself.
Another mistake visible in your error log is for code line
Predict the next word using the model, the input document and the current state of output
you have used variable name tokenized_question for input document, where as the input document would be the padded_question when you padded the tensor to the tokenized_question in the previous code lines.