Exercise 07 NotImplementedError in sampling_decode

Hello. I receive an NotImplementedError error when executing code
sampling_decode(“I love languages.”, NMTAttn=model, temperature=0.0, vocab_file=VOCAB_FILE, vocab_dir=VOCAB_DIR)

But all previous tests were passed. Is it possible to check my notebook for errors?

{Moderator’s Edit: Solution Code Removed}

Hey @Algus,
Welcome to the community. Let’s break down the error stack here. You will find that the stack points out that there is an issue in this line of code:

output, _ = NMTAttn.forward((input_tokens, padded_with_batch))

This means that there might be an issue in your implementation of NMTAttn. Going back to your implementation of the same, you will find that while running the AttentionQKV, you haven’t defined the mode. Define it as per the needs, and re-run your code cells. Let me know if this helps.

P.S. - Posting code publicly is strictly against the community guidelines. Please refrain from doing so in the future. If a mentor needs to take a look at your code, (s)he will ask you to DM it.

Cheers,
Elemento

Thank you! It helped