# Adding tokens to mT5, tensorflow get ValueError

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-tokens-to-mt5-tensorflow-get-valueerror%2F9084%3E%5C
**Category:** 🤗Transformers\
**Created:** [August 9, 2021, 12:44pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-tokens-to-mt5-tensorflow-get-valueerror%2F9084 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftakiholadi)%5C
**Post date:** [August 9, 2021, 12:44pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadding-tokens-to-mt5-tensorflow-get-valueerror%2F9084%2F1 "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.
