"yhat = np.argmax(yhat.to(“cpu”).detach().numpy()) "
i am using argmax for converting  probability to integer and i think this is what you said right?
since this integer value maps a word in my vocabulary i am able to predict the next word this way without a sofmax i guess.