code: 
  
  import json
  from typing import List, Optional, Tuple
  
  from tokenizers import normalizers
  
  from ...tokenization_utils_fast import PreTrainedTokenizerFast
  from ...utils import logging
  from .tokenization_splinter import SplinterTokenizer
  
  
  lowerCamelCase     =      logging.get_logger(__name__)
  
  lowerCamelCase     =      {"""vocab_file""": """vocab.txt"""}
  
  lowerCamelCase     =      {
      """vocab_file""": {
          """tau/splinter-base""": """https://huggingface.co/tau/splinter-base/resolve/main/vocab.txt""",
          """tau/splinter-base-qass""": """https://huggingface.co/tau/splinter-base-qass/resolve/main/vocab.txt""",
          """tau/splinter-large""": """https://huggingface.co/tau/splinter-large/resolve/main/vocab.txt""",
          """tau/splinter-large-qass""": """https://huggingface.co/tau/splinter-large-qass/resolve/main/vocab.txt""",
      }
  }
  
  lowerCamelCase     =      {
      """tau/splinter-base""": 512,
      """tau/splinter-base-qass""": 512,
      """tau/splinter-large""": 512,
      """tau/splinter-large-qass""": 512,
  }
  
  lowerCamelCase     =      {
      """tau/splinter-base""": {"""do_lower_case""": False},
      """tau/splinter-base-qass""": {"""do_lower_case""": False},
      """tau/splinter-large""": {"""do_lower_case""": False},
      """tau/splinter-large-qass""": {"""do_lower_case""": False},
  }
  
  
  
  
  
  
  
  class 		__magic_name__    (							_a							):
  
     '''simple docstring'''
  
  
  
  
     lowerCamelCase__				:			str												=     VOCAB_FILES_NAMES
     lowerCamelCase__				:			str												=     PRETRAINED_VOCAB_FILES_MAP
     lowerCamelCase__				:			Dict												=     PRETRAINED_INIT_CONFIGURATION
     lowerCamelCase__				:			List[str]												=     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     lowerCamelCase__				:			List[str]												=     SplinterTokenizer
  
  
  
     def __init__(       self,					lowercase_=None,					lowercase_=None,					lowercase_=True,					lowercase_="[UNK]",					lowercase_="[SEP]",					lowercase_="[PAD]",					lowercase_="[CLS]",					lowercase_="[MASK]",					lowercase_="[QUESTION]",					lowercase_=True,					lowercase_=None,					**lowercase_,					)							->					List[str]:
  
  
  
  
  
  
       """simple docstring"""
  
  
  
  
  
  
       super().__init__(
           lowerCamelCase__,					tokenizer_file=lowerCamelCase__,					do_lower_case=lowerCamelCase__,					unk_token=lowerCamelCase__,					sep_token=lowerCamelCase__,					pad_token=lowerCamelCase__,					cls_token=lowerCamelCase__,					mask_token=lowerCamelCase__,					tokenize_chinese_chars=lowerCamelCase__,					strip_accents=lowerCamelCase__,					additional_special_tokens=(question_token,),					**lowerCamelCase__,					)
  
       a__						=json.loads(self.backend_tokenizer.normalizer.__getstate__() )
       if (
           pre_tok_state.get('''lowercase''',					lowerCamelCase__ ) != do_lower_case
           or pre_tok_state.get('''strip_accents''',					lowerCamelCase__ ) != strip_accents
       ):
         a__						=getattr(lowerCamelCase__,					pre_tok_state.pop('''type''' ) )
         a__						=do_lower_case
         a__						=strip_accents
         a__						=pre_tok_class(**lowerCamelCase__ )
  
       a__						=do_lower_case
  
  
  
     @property
     def 				_UpperCAmelCase				(       self )							->					Optional[int]:
  
  
  
  
  
  
       """simple docstring"""
  
  
  
  
  
  
       return self.convert_tokens_to_ids(self.question_token )
  
  
  
     def 				_UpperCAmelCase				(       self,					lowercase_,					lowercase_ = None )							->					Tuple:
  
  
  
  
  
  
       """simple docstring"""
  
  
  
  
  
  
       if token_ids_a is None:
         return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
  
       a__						=[self.cls_token_id]
       a__						=[self.sep_token_id]
       a__						=[self.question_token_id] + [self.convert_tokens_to_ids('''.''' )]
       if self.padding_side == "right":
         # Input is question-then-context
         return cls + token_ids_a + question_suffix + sep + token_ids_a + sep
       else:
         # Input is context-then-question
         return cls + token_ids_a + sep + token_ids_a + question_suffix + sep
  
  
  
     def 				_UpperCAmelCase				(       self,					lowercase_,					lowercase_ = None )							->					List[str]:
  
  
  
  
  
  
       """simple docstring"""
  
  
  
  
  
  
       a__						=[self.sep_token_id]
       a__						=[self.cls_token_id]
       a__						=[self.question_token_id] + [self.convert_tokens_to_ids('''.''' )]
       if token_ids_a is None:
         return len(cls + token_ids_a + sep ) * [0]
  
       if self.padding_side == "right":
         # Input is question-then-context
         return len(cls + token_ids_a + question_suffix + sep ) * [0] + len(token_ids_a + sep ) * [1]
       else:
         # Input is context-then-question
         return len(cls + token_ids_a + sep ) * [0] + len(token_ids_a + question_suffix + sep ) * [1]
  
  
  
     def 				_UpperCAmelCase				(       self,					lowercase_,					lowercase_ = None )							->					List[str]:
  
  
  
  
  
  
       """simple docstring"""
  
  
  
  
  
  
       a__						=self._tokenizer.model.save(lowerCamelCase__,					name=lowerCamelCase__ )
       return tuple(lowerCamelCase__ )
  
style_context: 
  
  from dataclasses import dataclass
  from typing import List, Optional, Union
  
  import numpy as np
  import PIL
  from PIL import Image
  
  from ...utils import BaseOutput, is_torch_available, is_transformers_available
  
  
  
  
  
  
  
  @dataclass
  # Copied from diffusers.pipelines.stable_diffusion.__init__.StableDiffusionPipelineOutput with Stable->Alt
  class 		__magic_name__    (							lowerCamelCase__							):
  
     '''simple docstring'''
  
  
  
  
     lowerCamelCase__				:			Union[List[PIL.Image.Image], np.ndarray]
     lowerCamelCase__				:			Optional[List[bool]]
  
  
  if is_transformers_available() and is_torch_available():
         from .modeling_roberta_series import RobertaSeriesModelWithTransformation
         from .pipeline_alt_diffusion import AltDiffusionPipeline
         from .pipeline_alt_diffusion_imgaimg import AltDiffusionImgaImgPipeline
  