Update encode function slowTokenizer vs FastTokenizer

Hello,

I am trying to build a personalized tokenizer on top on GPT2 Tokenizer, so that’s why I am modifying the code. I want to build encode words following a specific manner.

The code for the slow tokenizer is here:

The code for the fast tokenizer is here:

To do pre-tokenization for the slowTokenizer is use “_tokenize()” method.

My question is how to do the same for the fast tokenizer?