text icon indicating copy to clipboard operation
text copied to clipboard

Fix vocab_size in PositionalEmbedding in Transformer notebook

Open 8bitmp3 opened this issue 1 year ago • 2 comments

@MarkDaoust @markmcd

Also addresses https://github.com/tensorflow/text/issues/1264

8bitmp3 avatar Apr 09 '24 15:04 8bitmp3

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

I corrected the code as suggested by Mark Doust and that solved the problem. Thank you! The code is:

embed_pt = PositionalEmbedding(vocab_size=tokenizers.pt.get_vocab_size().numpy(), d_model=512) embed_en = PositionalEmbedding(vocab_size=tokenizers.en.get_vocab_size().numpy(), d_model=512)

That said, why is that correction not added to the notebook at the TF site??

JuanVargas avatar May 01 '24 13:05 JuanVargas