src/transformers/models/layoutxlm/tokenization_layoutxlm.py/LayoutXLMTokenizer/__getstate__
class LayoutXLMTokenizer:    def __getstate__(self):
        state = self.__dict__.copy()
        state["sp_model"] = None
        state["sp_model_proto"] = self.sp_model.serialized_model_proto()
        return state