





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


SCREAMING_SNAKE_CASE__       :			Union[str, Any]			      =						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       :			int			      =						{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

SCREAMING_SNAKE_CASE__       :			str			      =						{
    """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"""
        ),
    },
}

SCREAMING_SNAKE_CASE__       :			int			      =						{
    """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,
}


SCREAMING_SNAKE_CASE__       :			Optional[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   __lowerCAmelCase			(					_UpperCamelCase  ):
   _UpperCamelCase :						List[Any]     		=				VOCAB_FILES_NAMES
   _UpperCamelCase :						Tuple     		=				PRETRAINED_VOCAB_FILES_MAP
   _UpperCamelCase :						Tuple     		=				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   _UpperCamelCase :						Optional[int]     		=				PRETRAINED_INIT_CONFIGURATION
   _UpperCamelCase :						Dict     		=				["""input_ids""", """attention_mask"""]
   _UpperCamelCase :						List[Any]     		=				DistilBertTokenizer





   def __init__( self					,			snake_case=None					,			snake_case=None					,			snake_case=True					,			snake_case="[UNK]"					,			snake_case="[SEP]"					,			snake_case="[PAD]"					,			snake_case="[CLS]"					,			snake_case="[MASK]"					,			snake_case=True					,			snake_case=None					,			**snake_case					,			)				->  List[Any]:
      """simple docstring"""





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

      a__	:						int      		=  json.loads(self.backend_tokenizer.normalizer.__getstate__()      )
      if (
          normalizer_state.get("lowercase"					,			snake_case      ) != do_lower_case
          or normalizer_state.get("strip_accents"					,			snake_case      ) != strip_accents
          or normalizer_state.get("handle_chinese_chars"					,			snake_case      ) != tokenize_chinese_chars
      ):
         a__	:						List[Any]      		=  getattr(snake_case					,			normalizer_state.pop("type"      )      )
         a__	:						Dict      		=  do_lower_case
         a__	:						Optional[Any]      		=  strip_accents
         a__	:						Dict      		=  tokenize_chinese_chars
         a__	:						Any      		=  normalizer_class(**snake_case      )

      a__	:						List[Any]      		=  do_lower_case





   def 	_snake_case ( self					,			snake_case					,			snake_case=None      )				->  Any:
      """simple docstring"""





      a__	:						Union[str, Any]      		=  [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 	_snake_case ( self					,			snake_case					,			snake_case = None      )				->  List[int]:
      """simple docstring"""





      a__	:						Tuple      		=  [self.sep_token_id]
      a__	:						str      		=  [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 	_snake_case ( self					,			snake_case					,			snake_case = None      )				->  Tuple[str]:
      """simple docstring"""





      a__	:						Optional[int]      		=  self._tokenizer.model.save(snake_case					,			name=snake_case      )
      return tuple(snake_case      )








from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


SCREAMING_SNAKE_CASE__       :			Dict			      =						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       :			Any			      =						{
    """google/mobilenet_v2_1.4_224""": """https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json""",
    """google/mobilenet_v2_1.0_224""": """https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json""",
    """google/mobilenet_v2_0.75_160""": """https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json""",
    """google/mobilenet_v2_0.35_96""": """https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json""",
    # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2
}







class   __lowerCAmelCase			(					_UpperCamelCase  ):
   _UpperCamelCase :						Optional[int]     		=				"""mobilenet_v2"""





   def __init__( self					,			snake_case=3					,			snake_case=224					,			snake_case=1.0					,			snake_case=8					,			snake_case=8					,			snake_case=6					,			snake_case=32					,			snake_case=True					,			snake_case=True					,			snake_case="relu6"					,			snake_case=True					,			snake_case=0.8					,			snake_case=0.02					,			snake_case=0.001					,			snake_case=255					,			**snake_case					,			)				->  int:
      """simple docstring"""





      super().__init__(**snake_case      )

      if depth_multiplier <= 0:
         raise ValueError("depth_multiplier must be greater than zero."      )

      a__	:						str      		=  num_channels
      a__	:						Dict      		=  image_size
      a__	:						Any      		=  depth_multiplier
      a__	:						str      		=  depth_divisible_by
      a__	:						Optional[int]      		=  min_depth
      a__	:						Dict      		=  expand_ratio
      a__	:						str      		=  output_stride
      a__	:						Optional[int]      		=  first_layer_is_expansion
      a__	:						Union[str, Any]      		=  finegrained_output
      a__	:						Union[str, Any]      		=  hidden_act
      a__	:						str      		=  tf_padding
      a__	:						List[Any]      		=  classifier_dropout_prob
      a__	:						List[Any]      		=  initializer_range
      a__	:						Optional[Any]      		=  layer_norm_eps
      a__	:						str      		=  semantic_loss_ignore_index







class   __lowerCAmelCase			(					_UpperCamelCase  ):
   _UpperCamelCase :						Any     		=				version.parse("""1.11"""  )





   @property
   def 	_snake_case ( self      )				->  Mapping[str, Mapping[int, str]]:
      """simple docstring"""





      return OrderedDict([("pixel_values", {0: "batch"})]      )





   @property
   def 	_snake_case ( self      )				->  Mapping[str, Mapping[int, str]]:
      """simple docstring"""





      if self.task == "image-classification":
         return OrderedDict([("logits", {0: "batch"})]      )
      else:
         return OrderedDict([("last_hidden_state", {0: "batch"}), ("pooler_output", {0: "batch"})]      )





   @property
   def 	_snake_case ( self      )				->  float:
      """simple docstring"""





      return 1E-4

