src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py/GPTSw3Tokenizer/__setstate__
class GPTSw3Tokenizer:    def __setstate__(self, d):
        self.__dict__ = d

        # for backward compatibility
        if not hasattr(self, "sp_model_kwargs"):
            self.sp_model_kwargs = {}

        self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
        self.sp_model.Load(self.vocab_file)