You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect the result of the above code to be True, however it is False.
Since the size of the tokenizer vocabulary and the embedding_size of the model are different, this causes unwanted behaviors. For example, in examples/pytorch/translation/run_translation.py there is this code fragment in charge of performing this same check, and in case it is not fulfilled it resizes the model embeddings.
Hey! Feel free to update that step, in general there is absolutely no guarantee that the tokenizer has the same length as the model's input embeddings:
you can have holes in your tokenizer's vocab
the embedding can be padded for performance reasons.
🤗
System Info
transformers
version: 4.42.3Who can help?
@ArthurZucker
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
I would expect the result of the above code to be True, however it is False.
Since the size of the tokenizer vocabulary and the
embedding_size
of the model are different, this causes unwanted behaviors. For example, inexamples/pytorch/translation/run_translation.py
there is this code fragment in charge of performing this same check, and in case it is not fulfilled it resizes the model embeddings.The text was updated successfully, but these errors were encountered: