Hi, I had the same issue.
This is because of an error in the evaluate() function, the input_lengths array incorrectly contains the number of characters in the sentence, instead of the number of words. Replace
input_lengths = [len(input_seq)]

with
input_lengths = [len(input_seq.split())]

and the error should go away.