I’m not familiar with your use case, but based on the output it seems you might be working on a sequence prediction task? If so, is each sample supposed to predict a word/token etc.?
In case you are using another repository as your code base, I would probably check if this repo might already implement a predict method.