C4_W1 UNQ_C10 Error Message

I’m having an issue with the mbr_decode exercise, and my lab ID is: wihywyztnryo

Error message is:

TypeError Traceback (most recent call last)
in
----> 1 mbr_decode(your_sentence, 4, average_overlap, jaccard_similarity, model, TEMPERATURE, vocab_file=VOCAB_FILE, vocab_dir=VOCAB_DIR)[0]

in mbr_decode(sentence, n_samples, score_fn, similarity_fn, NMTAttn, temperature, vocab_file, vocab_dir, generate_samples, sampling_decode, next_symbol, tokenize, detokenize)
35
36 # detokenize the token list associated with the max_score_key
—> 37 translated_sentence = detokenize(scores[max_score_key], vocab_file, vocab_dir)
38
39 ### END CODE HERE ###

in detokenize(integers, vocab_file, vocab_dir)
43
44 # Remove the dimensions of size 1
—> 45 integers = list(np.squeeze(integers))
46
47 # Set the encoding of the “end of sentence” as 1

TypeError: iteration over a 0-d array

Any help is much appreciated.

Thanks
Rama

Hi @Rama_Mahajanam

Most probably you have some mistake in generate_samples implementation. But it’s hard to pinpoint the exact reason why your array lacks a dimension. If you can’t find the problem, please private message me with your notebook attached.

Cheers