deleted references of self.vocab_size and self.type_vocab_size for multiple models [TF implementation]
Author: susnato
Pull request: yes

# What does this PR do?

This PR deletes references of  `self.vocab_size` and `self.type_vocab_size` for 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.
<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->



## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.([link](https://github.com/huggingface/transformers/issues/21053))
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@gante

Comments:
Hi, @gante as you said [here](https://github.com/huggingface/transformers/pull/21065#issuecomment-1385233073) I made changes for `src/transformers/models/albert/modeling_tf_albert.py`, could you please check it? If it's ok then I will push other changes of other models.

The failed test `ci/circleci: check_repository_consistency` are due to the fact that I only changed Embeddings for albert model and it is different from TFBertEmbeddings , the test will be successful when I change them too. 

_The documentation is not available anymore as the PR was closed or merged._

@susnato before moving forward, let's make sure our `transformers` master agrees with the set of changes we are about to make :)

_________________________________
@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 `config` attributes are not constant throughout the model's life, like `config.vocab_size`, and our TF implementation stores them as immutable class attributes (e.g. `self.vocab_size = config.vocab_size`). PT doesn't have this problem, since it simply stores `self.config = config` in the layers, which benefits from the updates the mutable `config` dictionary may receive elsewhere.

The proposed change is to make TF implementation closer to PT implementation and store `self.config` in the layers, as opposed to individual configuration parameters. This also solves the bug that triggered this discussion, where the vocabulary size was not being correctly updated and causing exceptions.

Let us know if you are okay with us making this change over most model architectures 🚀 

@susnato you might need to run `make fixup` locally, to automatically format the code and make our CI happy

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? 

> LGTM +1
> 
> Can we edit the PR title to a shorter one before merging? sweat_smile

@gante Done!

Awesome!  

Thank you for all the work you've put into fixing this, @susnato 🤗