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_layoutlm import LayoutLMTokenizer
  
  
  _lowercase		:     Optional[Any] 					=logging.get_logger(__name__)
  
  _lowercase		:     Any 					={"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}
  
  _lowercase		:     List[str] 					={
      """vocab_file""": {
          """microsoft/layoutlm-base-uncased""": (
              """https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt"""
          ),
          """microsoft/layoutlm-large-uncased""": (
              """https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt"""
          ),
      },
      """tokenizer_file""": {
          """microsoft/layoutlm-base-uncased""": (
              """https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json"""
          ),
          """microsoft/layoutlm-large-uncased""": (
              """https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json"""
          ),
      },
  }
  
  _lowercase		:     List[Any] 					={
      """microsoft/layoutlm-base-uncased""": 512,
      """microsoft/layoutlm-large-uncased""": 512,
  }
  
  _lowercase		:     Tuple 					={
      """microsoft/layoutlm-base-uncased""": {"""do_lower_case""": True},
      """microsoft/layoutlm-large-uncased""": {"""do_lower_case""": True},
  }
  
  
  
  
  
  
  class 	UpperCamelCase_     (     snake_case__       ):
  					_a			:	Tuple							=				VOCAB_FILES_NAMES
  					_a			:	Dict							=				PRETRAINED_VOCAB_FILES_MAP
  					_a			:	str							=				PRETRAINED_INIT_CONFIGURATION
  					_a			:	int							=				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  					_a			:	Any							=				LayoutLMTokenizer
  
  
  
  					def __init__(		self    :    int					,			lowerCamelCase    :    List[Any]=None					,			lowerCamelCase    :    Union[str, Any]=None					,			lowerCamelCase    :    Optional[Any]=True					,			lowerCamelCase    :    Optional[int]="[UNK]"					,			lowerCamelCase    :    str="[SEP]"					,			lowerCamelCase    :    int="[PAD]"					,			lowerCamelCase    :    List[Any]="[CLS]"					,			lowerCamelCase    :    Union[str, Any]="[MASK]"					,			lowerCamelCase    :    str=True					,			lowerCamelCase    :    Optional[int]=None					,			**lowerCamelCase    :    Dict					,			):
  							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					,			**lowerCamelCase					,			)
  
  							lowerCamelCase_  :    str   	=			json.loads(self.backend_tokenizer.normalizer.__getstate__()	)
  							if (
  							    normalizer_state.get('lowercase'					,			lowerCamelCase	) != do_lower_case
  							    or normalizer_state.get('strip_accents'					,			lowerCamelCase	) != strip_accents
  							    or normalizer_state.get('handle_chinese_chars'					,			lowerCamelCase	) != tokenize_chinese_chars
  							):
  									lowerCamelCase_  :    Optional[int]   	=			getattr(lowerCamelCase					,			normalizer_state.pop('type'	)	)
  									lowerCamelCase_  :    List[Any]   	=			do_lower_case
  									lowerCamelCase_  :    List[Any]   	=			strip_accents
  									lowerCamelCase_  :    Dict   	=			tokenize_chinese_chars
  									lowerCamelCase_  :    List[Any]   	=			normalizer_class(**lowerCamelCase	)
  
  							lowerCamelCase_  :    str   	=			do_lower_case
  
  
  
  					def      __a    (		self    :    Optional[Any]					,			lowerCamelCase    :    Dict					,			lowerCamelCase    :    List[str]=None	):
  							lowerCamelCase_  :    Dict   	=			[self.cls_token_id] + token_ids_a + [self.sep_token_id]
  
  							if token_ids_a:
  									output += token_ids_a + [self.sep_token_id]
  
  							return output
  
  
  
  					def      __a    (		self    :    Optional[int]					,			lowerCamelCase    :    List[int]					,			lowerCamelCase    :    Optional[List[int]] = None	):
  							lowerCamelCase_  :    int   	=			[self.sep_token_id]
  							lowerCamelCase_  :    int   	=			[self.cls_token_id]
  							if token_ids_a is None:
  									return len(cls + token_ids_a + sep	) * [0]
  							return len(cls + token_ids_a + sep	) * [0] + len(token_ids_a + sep	) * [1]
  
  
  
  
  
  					def      __a    (		self    :    Union[str, Any]					,			lowerCamelCase    :    str					,			lowerCamelCase    :    Optional[str] = None	):
  							lowerCamelCase_  :    Union[str, Any]   	=			self._tokenizer.model.save(lowerCamelCase					,			name=lowerCamelCase	)
  							return tuple(lowerCamelCase	)
  
style_context: 
  
  
  
  
  
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  
  
  _lowercase		:     Dict 					=logging.get_logger(__name__)
  
  _lowercase		:     Any 					={
      """dandelin/vilt-b32-mlm""": """https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json"""
  }
  
  
  
  
  
  
  class 	UpperCamelCase_     (     snake_case__       ):
  					_a			:	List[str]							=				'vilt'
  
  
  
  					def __init__(		self    :    int					,			lowerCamelCase    :    Any=3_05_22					,			lowerCamelCase    :    Union[str, Any]=2					,			lowerCamelCase    :    Optional[Any]=2					,			lowerCamelCase    :    str=40					,			lowerCamelCase    :    List[str]=7_68					,			lowerCamelCase    :    Optional[int]=12					,			lowerCamelCase    :    List[Any]=12					,			lowerCamelCase    :    List[str]=30_72					,			lowerCamelCase    :    Union[str, Any]="gelu"					,			lowerCamelCase    :    int=0.0					,			lowerCamelCase    :    str=0.0					,			lowerCamelCase    :    int=0.02					,			lowerCamelCase    :    Union[str, Any]=1E-12					,			lowerCamelCase    :    Dict=3_84					,			lowerCamelCase    :    List[str]=32					,			lowerCamelCase    :    Dict=3					,			lowerCamelCase    :    List[str]=True					,			lowerCamelCase    :    int=-1					,			lowerCamelCase    :    List[Any]=False					,			lowerCamelCase    :    Any=-1					,			**lowerCamelCase    :    str					,			):
  							super().__init__(tie_word_embeddings=lowerCamelCase					,			**lowerCamelCase	)
  
  							lowerCamelCase_  :    str   	=			vocab_size
  							lowerCamelCase_  :    Dict   	=			type_vocab_size
  							lowerCamelCase_  :    str   	=			modality_type_vocab_size
  							lowerCamelCase_  :    Optional[Any]   	=			max_position_embeddings
  
  							lowerCamelCase_  :    List[Any]   	=			hidden_size
  							lowerCamelCase_  :    Union[str, Any]   	=			num_hidden_layers
  							lowerCamelCase_  :    Any   	=			num_attention_heads
  							lowerCamelCase_  :    List[Any]   	=			intermediate_size
  							lowerCamelCase_  :    Union[str, Any]   	=			hidden_act
  							lowerCamelCase_  :    Any   	=			hidden_dropout_prob
  							lowerCamelCase_  :    Optional[int]   	=			attention_probs_dropout_prob
  							lowerCamelCase_  :    Any   	=			initializer_range
  							lowerCamelCase_  :    str   	=			layer_norm_eps
  
  							lowerCamelCase_  :    Optional[Any]   	=			image_size
  							lowerCamelCase_  :    List[Any]   	=			patch_size
  							lowerCamelCase_  :    Tuple   	=			num_channels
  							lowerCamelCase_  :    Optional[Any]   	=			qkv_bias
  							lowerCamelCase_  :    Optional[int]   	=			max_image_length
  							lowerCamelCase_  :    Optional[Any]   	=			num_images
  