
import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_distilbert import DistilBertTokenizer


lowerCamelCase__     :		Tuple        = logging.get_logger(__name__)

lowerCamelCase__     :		Optional[int]        = {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

lowerCamelCase__     :		List[Any]        = {
    """vocab_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-german-cased""": """https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt""",
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/tokenizer.json""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/tokenizer.json""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-german-cased""": (
            """https://huggingface.co/distilbert-base-german-cased/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/tokenizer.json"""
        ),
    },
}

lowerCamelCase__     :		Dict        = {
    """distilbert-base-uncased""": 5_1_2,
    """distilbert-base-uncased-distilled-squad""": 5_1_2,
    """distilbert-base-cased""": 5_1_2,
    """distilbert-base-cased-distilled-squad""": 5_1_2,
    """distilbert-base-german-cased""": 5_1_2,
    """distilbert-base-multilingual-cased""": 5_1_2,
}


lowerCamelCase__     :		List[Any]        = {
    """distilbert-base-uncased""": {"""do_lower_case""": True},
    """distilbert-base-uncased-distilled-squad""": {"""do_lower_case""": True},
    """distilbert-base-cased""": {"""do_lower_case""": False},
    """distilbert-base-cased-distilled-squad""": {"""do_lower_case""": False},
    """distilbert-base-german-cased""": {"""do_lower_case""": False},
    """distilbert-base-multilingual-cased""": {"""do_lower_case""": False},
}



class    _snake_case (						UpperCAmelCase_				):
 __lowerCAmelCase	:  Any	   =      VOCAB_FILES_NAMES
 __lowerCAmelCase	:  Optional[Any]	   =      PRETRAINED_VOCAB_FILES_MAP
 __lowerCAmelCase	:  str	   =      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 __lowerCAmelCase	:  Optional[Any]	   =      PRETRAINED_INIT_CONFIGURATION
 __lowerCAmelCase	:  int	   =      ['input_ids', 'attention_mask']
 __lowerCAmelCase	:  Optional[Any]	   =      DistilBertTokenizer


 def __init__(       self       ,	SCREAMING_SNAKE_CASE_=None       ,	SCREAMING_SNAKE_CASE_=None       ,	SCREAMING_SNAKE_CASE_=True       ,	SCREAMING_SNAKE_CASE_="[UNK]"       ,	SCREAMING_SNAKE_CASE_="[SEP]"       ,	SCREAMING_SNAKE_CASE_="[PAD]"       ,	SCREAMING_SNAKE_CASE_="[CLS]"       ,	SCREAMING_SNAKE_CASE_="[MASK]"       ,	SCREAMING_SNAKE_CASE_=True       ,	SCREAMING_SNAKE_CASE_=None       ,	**SCREAMING_SNAKE_CASE_       ,	):


   '''simple docstring'''




   super().__init__(
       SCREAMING_SNAKE_CASE_       ,	tokenizer_file=SCREAMING_SNAKE_CASE_       ,	do_lower_case=SCREAMING_SNAKE_CASE_       ,	unk_token=SCREAMING_SNAKE_CASE_       ,	sep_token=SCREAMING_SNAKE_CASE_       ,	pad_token=SCREAMING_SNAKE_CASE_       ,	cls_token=SCREAMING_SNAKE_CASE_       ,	mask_token=SCREAMING_SNAKE_CASE_       ,	tokenize_chinese_chars=SCREAMING_SNAKE_CASE_       ,	strip_accents=SCREAMING_SNAKE_CASE_       ,	**SCREAMING_SNAKE_CASE_       ,	)

   lowercase__	: Optional[int]     		=   json.loads(self.backend_tokenizer.normalizer.__getstate__())
   if (
       normalizer_state.get("""lowercase"""       ,	SCREAMING_SNAKE_CASE_) != do_lower_case
       or normalizer_state.get("""strip_accents"""       ,	SCREAMING_SNAKE_CASE_) != strip_accents
       or normalizer_state.get("""handle_chinese_chars"""       ,	SCREAMING_SNAKE_CASE_) != tokenize_chinese_chars
   ):
     lowercase__	: Tuple     		=   getattr(SCREAMING_SNAKE_CASE_       ,	normalizer_state.pop("""type"""))
     lowercase__	: int     		=   do_lower_case
     lowercase__	: str     		=   strip_accents
     lowercase__	: str     		=   tokenize_chinese_chars
     lowercase__	: int     		=   normalizer_class(**SCREAMING_SNAKE_CASE_)

   lowercase__	: Optional[Any]     		=   do_lower_case


 def   lowercase__  (       self       ,	SCREAMING_SNAKE_CASE_       ,	SCREAMING_SNAKE_CASE_=None):


   '''simple docstring'''




   lowercase__	: Tuple     		=   [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   lowercase__  (       self       ,	SCREAMING_SNAKE_CASE_       ,	SCREAMING_SNAKE_CASE_ = None):


   '''simple docstring'''




   lowercase__	: int     		=   [self.sep_token_id]
   lowercase__	: 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   lowercase__  (       self       ,	SCREAMING_SNAKE_CASE_       ,	SCREAMING_SNAKE_CASE_ = None):


   '''simple docstring'''




   lowercase__	: Dict     		=   self._tokenizer.model.save(SCREAMING_SNAKE_CASE_       ,	name=SCREAMING_SNAKE_CASE_)
   return tuple(SCREAMING_SNAKE_CASE_)








'''simple docstring'''

from ....configuration_utils import PretrainedConfig
from ....utils import logging


snake_case									=    logging.get_logger(__name__)

snake_case									=    {
    """Visual-Attention-Network/van-base""": (
        """https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json"""
    ),
}




class    lowerCAmelCase       (     UpperCamelCase_  ):
 A_				:				Tuple	=			"""van"""


 def __init__(    self  : List[Any]			,							a__  : Dict=224			,							a__  : Dict=3			,							a__  : Union[str, Any]=[7, 3, 3, 3]			,							a__  : Optional[Any]=[4, 2, 2, 2]			,							a__  : Optional[Any]=[64, 128, 320, 512]			,							a__  : List[str]=[3, 3, 12, 3]			,							a__  : Any=[8, 8, 4, 4]			,							a__  : Optional[int]="gelu"			,							a__  : List[Any]=0.02			,							a__  : Tuple=1e-6			,							a__  : List[str]=1e-2			,							a__  : List[str]=0.0			,							a__  : List[Any]=0.0			,							**a__  : Tuple			,							):
  '''simple docstring'''

  super().__init__(**a__    )
  lowerCAmelCase__     :   Any     		=	image_size
  lowerCAmelCase__     :   Tuple     		=	num_channels
  lowerCAmelCase__     :   List[Any]     		=	patch_sizes
  lowerCAmelCase__     :   Dict     		=	strides
  lowerCAmelCase__     :   List[str]     		=	hidden_sizes
  lowerCAmelCase__     :   Union[str, Any]     		=	depths
  lowerCAmelCase__     :   Tuple     		=	mlp_ratios
  lowerCAmelCase__     :   Optional[Any]     		=	hidden_act
  lowerCAmelCase__     :   Dict     		=	initializer_range
  lowerCAmelCase__     :   int     		=	layer_norm_eps
  lowerCAmelCase__     :   Optional[Any]     		=	layer_scale_init_value
  lowerCAmelCase__     :   List[str]     		=	drop_path_rate
  lowerCAmelCase__     :   Any     		=	dropout_rate





