Working on the lab assignment, my notebook alway got stuck when testing greedy_decode on ‘You are almost done with the assignment!’. Apparently (after some debugging) I found that sampling_decode might get stuck in a loop nerver reaching EOS. As a workaround I now terminate the loop in sampling_decode after a certain length of the output sentence is reached.
Does anyone else observe the same?
Solved. As in other posts. Had a problem with log_probs = output…
I am having the same question. The model can’t output EOS. Which other posts are related? I check log_probs = output[…] line, but I still have the problem. I tried getting the next token log prob, it didn’t work. I tried getting the very last token by using index -1, it didn’t work either (I don’t think this is correct either).
I found this post Which video of the week 1 is the reference for next symbol function? - #2 by arvyzukai. It is very useful. I basically have the same logic as explained in the comment. But still, the model doesn’t output EOS.