TF mT5 model is not adding new tokens into it's vocabulary.
Author: laddhakrishna
Pull request: no

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version: 4.11.2
- Platform: google colab
- Python version: 3.7.12
- PyTorch version (GPU?):
- Tensorflow version (GPU?): 2.6.0
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help @patrickvonplaten, @patil-suraj 

<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj 
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @Rocketknight1 
Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

Model hub:

- for issues with a model report at https://discuss.huggingface.co/ and tag the model's creator.

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->

## Information

Model I am using (Bert, XLNet ...):
I am using mT5 model. The problem arised when I am trying to resize the token embeddings. I added new special tokens to my tokenizer's vocabulary, when I resized the model's token embeddings according to the length of the tokenizer, I am facing the issue.  

Link for the notebook:  https://colab.research.google.com/drive/1ooKa5aQ_FAEnicxBL8bJnNAO4H9vFuv-?usp=sharing
Code from the notebook:  
!pip install transformers
!pip install sentencepiece
from transformers import TFMT5ForConditionalGeneration, T5Tokenizer
model = TFMT5ForConditionalGeneration.from_pretrained("google/mt5-base")
tokenizer = T5Tokenizer.from_pretrained("google/mt5-base")
tokenizer.add_special_tokens({'bos_token':'<bos>','eos_token':'<eos>'})
model._resize_token_embeddings(len(tokenizer))

The error message is: 
ValueError: Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.

The problem arises when using:

* [ ] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. You can directly run the code & check the error coming from the last line.
2. Also you can go the colab notebook & have a look at the error as well.
3.

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->


Comments:
This seems to be an issue with TF model cc @Rocketknight1 

@patrickvonplaten it seems there are no extra tokens in mt5 tokenizer and there's a mismatch between `tokenizer.vocab_size` and `config.vocab_size`. Is this a known issue?

Actually, everything looks fine for me here...

TFMT5Model and MT5Tokenier have a tokenizer mismatch because of the same reason as T5, see: https://github.com/huggingface/transformers/issues/4875

Apart from this the following code works:

```python
from transformers import TFMT5ForConditionalGeneration, T5Tokenizer
model = TFMT5ForConditionalGeneration.from_pretrained("google/mt5-base")
tokenizer = T5Tokenizer.from_pretrained("google/mt5-base")
tokenizer.add_special_tokens({'bos_token':'','eos_token':''})
model.resize_token_embeddings(len(tokenizer))
```

@laddhakrishna - is there any reason you used `model._resize_token_embeddings(...)` instead of `model.resize_token_embeddings(...)` ?


Sir even if we use --> model.resize_token_embeddings(...) ,still we are getting the same error. 
What can we do??

Hey @laddhakrishna,

could you provide a google colab that reproduces the error with `model.resize_token_embeddings(...)`? I didn't manage to reproduce the error. Thanks!

Colab notebook link:
https://colab.research.google.com/drive/1xSB7XlIgA7PrGTUqThZl-rkBknxLYc87?usp=sharing

Please have a look at it sir. 
Thanks!

Hey @laddhakrishna,

Thanks for the colab I can reproduce!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.

Maybe @Rocketknight1 or @gante can take a look?