# Adding tokens to mT5, tensorflow get ValueError

**URL:** <https://discuss.huggingface.co/t/adding-tokens-to-mt5-tensorflow-get-valueerror/9084>\
**Category:** 🤗Transformers\
**Created:** [August 9, 2021, 12:44pm UTC](https://discuss.huggingface.co/t/adding-tokens-to-mt5-tensorflow-get-valueerror/9084 "2021-08-09T12:44:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![takiholadi](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@takiholadi](https://discuss.huggingface.co/u/takiholadi)\
**Post date:** [August 9, 2021, 12:44pm UTC](https://discuss.huggingface.co/t/adding-tokens-to-mt5-tensorflow-get-valueerror/9084/1 "2021-08-09T12:44:13Z")

</div>

I am trying to add new tokens to mT5 model this way:

```auto
import transformers import MT5Tokenizer, TFMT5ForConditionalGeneration

tokenizer = MT5Tokenizer.from_pretrained('google/mt5-small')
model = TFMT5ForConditionalGeneration.from_pretrained('google/mt5-small')

tokenizer.add_tokens(['my_new_token_1'])

model.resize_token_embeddings(len(tokenizer))

```

But get the error:

```auto
ValueError: Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.

```

What am I doing wrong?

Same code with torch-version of model works well.
