Fix tokenizer saving and loading error
This PR is to address #6025
> This is great! Do you mind adding a test under `tests/test_tokenization_common.py` so that we may ensure this doesn't fail in the future?

Hi I added into an existing test. Please check if it's appropriate.<|||||>Hello! I added a more robust test and fixed the style issue. Thanks a lot for your contribution, merging as soon as all the tests show green!