deleted references of self.vocab_size and self.type_vocab_size for multiple models [TF implementation]#21164
Conversation
|
Hi, @gante as you said here I made changes for The failed test |
|
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
if you have the patience to do it, removing the other attributes that are set from config (like self.type_vocab_size) would also be great :) That way there will be a greater similarity between PT and TF 🧡
There was a problem hiding this comment.
Yes, that would be great!
There was a problem hiding this comment.
@gante
Ok, I will remove self.type_vocab_size, btw there seem to be 3 more lines
self.embedding_size = config.embedding_size
self.max_position_embeddings = config.max_position_embeddings
self.initializer_range = config.initializer_range
I don't think we need to change them for this purpose, right?
There was a problem hiding this comment.
It's not needed, but it would be a nice refactor :) Don't worry about it if you are not interested in making the change, we can pick it up afterward -- the vocab_size is the most important one for now, as it is causing bugs.
|
@susnato before moving forward, let's make sure our @sgugger this PR contains a change I want to apply across TF models, and @susnato is kindly doing the bulk of the work. In essence, some The proposed change is to make TF implementation closer to PT implementation and store Let us know if you are okay with us making this change over most model architectures 🚀 |
sgugger
left a comment
There was a problem hiding this comment.
I have always wondered why TensorFlow models did not store the config. Just pinging @Rocketknight1 to also have a look in case there is some TF-arcane behing this that would break something but otherwise all for this change!
There was a problem hiding this comment.
Yes, that would be great!
3772de9 to
0f75e19
Compare
|
@susnato you might need to run |
|
Hi, @gante I added all the models I found to have self.vocab_size and removed reference to self.vocab_size and self.type_vocab_size and also all the tests are passed! Could you please check it? |
gante
left a comment
There was a problem hiding this comment.
LGTM 👍
Can we edit the PR title to a shorter one before merging? 😅
@gante Done! |
|
Awesome! Thank you for all the work you've put into fixing this, @susnato 🤗 |
What does this PR do?
This PR deletes references of
self.vocab_sizeandself.type_vocab_sizefor these models [Tensorflow implementation] : bert, albert, lxmert, electra, tapas, convbert, layoutlm, gpt2, camembert, clip, ctrl, deberta, deberta_v2, distilbert, esm, funnel, gptj, groupvit, longformer, mobilebert, mpnet, openai, rembert, roberta, roberta_prelayernorm, roformer, xlm_roberta, xlnet.Before submitting
Pull Request section?
to it if that's the case.(link)
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@gante