RuntimeError: Could not infer dtype of NoneType
### System Info

I was using microsoft/biogpt and gpt2 model on old script of run_ner.py that is (https://github.com/huggingface/transformers/blob/main/examples/legacy/token-classification/run_ner.py ) since both have slow tokenizer and  they both encountered same error that is 

RuntimeError: Could not infer dtype of NoneType

I have used the same dataset given in the repo and changed model name that's it.

### Who can help?

_No response_

### Information

- [x] The official example scripts
- [ ] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

1. change the model name to microsoft/biogpt
2. Follow the instruction given on the repo

### Expected behavior

it should train successfully 
Hi @TekeshwarHirwani 

The files under [transformers](https://github.com/huggingface/transformers/tree/main)/[examples](https://github.com/huggingface/transformers/tree/main/examples)/[legacy](https://github.com/huggingface/transformers/tree/main/examples/legacy) is no longer maintained: (from the README file)

> This folder contains examples which are not actively maintained (mostly contributed by the community).

> Using these examples together with a recent version of the library usually requires to make small (sometimes big) adaptations to get the scripts working.

You can use the files under [token-classification](https://github.com/huggingface/transformers/tree/main/examples/pytorch/token-classification) 🤗 <|||||>Thankyou for response, But the model I am using is microsoft/biogpt and it is having slow tokenizer, readme file of examples/tokenclassification/pytorch you have mentioned this :

Note: This script only works with models that have a fast tokenizer (backed by the 🤗 Tokenizers library) as it uses special features of those tokenizers. You can check if your favorite model has a fast tokenizer in [this table](https://huggingface.co/transformers/index.html#supported-frameworks), if it doesn't you can still use the old version of the script.
<|||||>Hi @TekeshwarHirwani 

In this situation, you will have to dive into the error messages, set some breakpoints, investigate the values of some variables to figure out why there is a None value. And see if you can modify the `legacy` code to make it work.

You can  try [Hugging Face Forums](https://discuss.huggingface.co/) to see if someone else had the same issues and if there are already some approaches.<|||||>Thanks 