"""simple docstring"""


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_bert import BertTokenizer


UpperCAmelCase__			=    logging.get_logger(__name__)

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

UpperCAmelCase__			=    {
    """vocab_file""": {
        """bert-base-uncased""": """https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt""",
        """bert-large-uncased""": """https://huggingface.co/bert-large-uncased/resolve/main/vocab.txt""",
        """bert-base-cased""": """https://huggingface.co/bert-base-cased/resolve/main/vocab.txt""",
        """bert-large-cased""": """https://huggingface.co/bert-large-cased/resolve/main/vocab.txt""",
        """bert-base-multilingual-uncased""": (
            """https://huggingface.co/bert-base-multilingual-uncased/resolve/main/vocab.txt"""
        ),
        """bert-base-multilingual-cased""": """https://huggingface.co/bert-base-multilingual-cased/resolve/main/vocab.txt""",
        """bert-base-chinese""": """https://huggingface.co/bert-base-chinese/resolve/main/vocab.txt""",
        """bert-base-german-cased""": """https://huggingface.co/bert-base-german-cased/resolve/main/vocab.txt""",
        """bert-large-uncased-whole-word-masking""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/vocab.txt"""
        ),
        """bert-large-cased-whole-word-masking""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/vocab.txt"""
        ),
        """bert-large-uncased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"""
        ),
        """bert-large-cased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"""
        ),
        """bert-base-cased-finetuned-mrpc""": (
            """https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/vocab.txt"""
        ),
        """bert-base-german-dbmdz-cased""": """https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/vocab.txt""",
        """bert-base-german-dbmdz-uncased""": (
            """https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/vocab.txt"""
        ),
        """TurkuNLP/bert-base-finnish-cased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/vocab.txt"""
        ),
        """TurkuNLP/bert-base-finnish-uncased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/vocab.txt"""
        ),
        """wietsedv/bert-base-dutch-cased""": (
            """https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """bert-base-uncased""": """https://huggingface.co/bert-base-uncased/resolve/main/tokenizer.json""",
        """bert-large-uncased""": """https://huggingface.co/bert-large-uncased/resolve/main/tokenizer.json""",
        """bert-base-cased""": """https://huggingface.co/bert-base-cased/resolve/main/tokenizer.json""",
        """bert-large-cased""": """https://huggingface.co/bert-large-cased/resolve/main/tokenizer.json""",
        """bert-base-multilingual-uncased""": (
            """https://huggingface.co/bert-base-multilingual-uncased/resolve/main/tokenizer.json"""
        ),
        """bert-base-multilingual-cased""": (
            """https://huggingface.co/bert-base-multilingual-cased/resolve/main/tokenizer.json"""
        ),
        """bert-base-chinese""": """https://huggingface.co/bert-base-chinese/resolve/main/tokenizer.json""",
        """bert-base-german-cased""": """https://huggingface.co/bert-base-german-cased/resolve/main/tokenizer.json""",
        """bert-large-uncased-whole-word-masking""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/tokenizer.json"""
        ),
        """bert-large-cased-whole-word-masking""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/tokenizer.json"""
        ),
        """bert-large-uncased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"""
        ),
        """bert-large-cased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"""
        ),
        """bert-base-cased-finetuned-mrpc""": (
            """https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/tokenizer.json"""
        ),
        """bert-base-german-dbmdz-cased""": (
            """https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/tokenizer.json"""
        ),
        """bert-base-german-dbmdz-uncased""": (
            """https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/tokenizer.json"""
        ),
        """TurkuNLP/bert-base-finnish-cased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/tokenizer.json"""
        ),
        """TurkuNLP/bert-base-finnish-uncased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/tokenizer.json"""
        ),
        """wietsedv/bert-base-dutch-cased""": (
            """https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/tokenizer.json"""
        ),
    },
}

UpperCAmelCase__			=    {
    """bert-base-uncased""": 5_1_2,
    """bert-large-uncased""": 5_1_2,
    """bert-base-cased""": 5_1_2,
    """bert-large-cased""": 5_1_2,
    """bert-base-multilingual-uncased""": 5_1_2,
    """bert-base-multilingual-cased""": 5_1_2,
    """bert-base-chinese""": 5_1_2,
    """bert-base-german-cased""": 5_1_2,
    """bert-large-uncased-whole-word-masking""": 5_1_2,
    """bert-large-cased-whole-word-masking""": 5_1_2,
    """bert-large-uncased-whole-word-masking-finetuned-squad""": 5_1_2,
    """bert-large-cased-whole-word-masking-finetuned-squad""": 5_1_2,
    """bert-base-cased-finetuned-mrpc""": 5_1_2,
    """bert-base-german-dbmdz-cased""": 5_1_2,
    """bert-base-german-dbmdz-uncased""": 5_1_2,
    """TurkuNLP/bert-base-finnish-cased-v1""": 5_1_2,
    """TurkuNLP/bert-base-finnish-uncased-v1""": 5_1_2,
    """wietsedv/bert-base-dutch-cased""": 5_1_2,
}

UpperCAmelCase__			=    {
    """bert-base-uncased""": {"""do_lower_case""": True},
    """bert-large-uncased""": {"""do_lower_case""": True},
    """bert-base-cased""": {"""do_lower_case""": False},
    """bert-large-cased""": {"""do_lower_case""": False},
    """bert-base-multilingual-uncased""": {"""do_lower_case""": True},
    """bert-base-multilingual-cased""": {"""do_lower_case""": False},
    """bert-base-chinese""": {"""do_lower_case""": False},
    """bert-base-german-cased""": {"""do_lower_case""": False},
    """bert-large-uncased-whole-word-masking""": {"""do_lower_case""": True},
    """bert-large-cased-whole-word-masking""": {"""do_lower_case""": False},
    """bert-large-uncased-whole-word-masking-finetuned-squad""": {"""do_lower_case""": True},
    """bert-large-cased-whole-word-masking-finetuned-squad""": {"""do_lower_case""": False},
    """bert-base-cased-finetuned-mrpc""": {"""do_lower_case""": False},
    """bert-base-german-dbmdz-cased""": {"""do_lower_case""": False},
    """bert-base-german-dbmdz-uncased""": {"""do_lower_case""": True},
    """TurkuNLP/bert-base-finnish-cased-v1""": {"""do_lower_case""": False},
    """TurkuNLP/bert-base-finnish-uncased-v1""": {"""do_lower_case""": True},
    """wietsedv/bert-base-dutch-cased""": {"""do_lower_case""": False},
}


class 							a					(		lowerCAmelCase_ ):
    _snake_case  :	Union[str, Any]  				=				VOCAB_FILES_NAMES
    _snake_case  :	int  				=				PRETRAINED_VOCAB_FILES_MAP
    _snake_case  :	List[Any]  				=				PRETRAINED_INIT_CONFIGURATION
    _snake_case  :	Dict  				=				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    _snake_case  :	Union[str, Any]  				=				BertTokenizer


    def __init__(       self						:	List[Any] ,					__lowerCAmelCase						:	Optional[Any]=None ,					__lowerCAmelCase						:	Any=None ,					__lowerCAmelCase						:	Union[str, Any]=True ,					__lowerCAmelCase						:	str="[UNK]" ,					__lowerCAmelCase						:	Tuple="[SEP]" ,					__lowerCAmelCase						:	List[Any]="[PAD]" ,					__lowerCAmelCase						:	Optional[Any]="[CLS]" ,					__lowerCAmelCase						:	List[Any]="[MASK]" ,					__lowerCAmelCase						:	str=True ,					__lowerCAmelCase						:	Optional[Any]=None ,					**__lowerCAmelCase						:	int ,					):
      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 ,					)

      _UpperCAmelCase    			=   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
      ):
        _UpperCAmelCase    			=   getattr(__lowerCAmelCase ,					normalizer_state.pop("""type"""       )       )
        _UpperCAmelCase    			=   do_lower_case
        _UpperCAmelCase    			=   strip_accents
        _UpperCAmelCase    			=   tokenize_chinese_chars
        _UpperCAmelCase    			=   normalizer_class(**__lowerCAmelCase       )

      _UpperCAmelCase    			=   do_lower_case


    def   lowerCAmelCase_	(       self						:	str ,					__lowerCAmelCase						:	int ,					__lowerCAmelCase						:	List[Any]=None       ):
      _UpperCAmelCase    			=   [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   lowerCAmelCase_	(       self						:	Optional[int] ,					__lowerCAmelCase						:	List[int] ,					__lowerCAmelCase						:	Optional[List[int]] = None       ):
      _UpperCAmelCase    			=   [self.sep_token_id]
      _UpperCAmelCase    			=   [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   lowerCAmelCase_	(       self						:	Optional[Any] ,					__lowerCAmelCase						:	str ,					__lowerCAmelCase						:	Optional[str] = None       ):
      _UpperCAmelCase    			=   self._tokenizer.model.save(__lowerCAmelCase ,					name=__lowerCAmelCase       )
      return tuple(__lowerCAmelCase       )

"""simple docstring"""


from collections import OrderedDict
from typing import List, Mapping

from packaging import version

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


UpperCAmelCase__			=    logging.get_logger(__name__)

UpperCAmelCase__			=    {
    """google/efficientnet-b7""": """https://huggingface.co/google/efficientnet-b7/resolve/main/config.json""",
}


class 							a					(		lowerCAmelCase_ ):
    _snake_case  :	Tuple  				=				'efficientnet'


    def __init__(       self						:	int ,					__lowerCAmelCase						:	int = 3 ,					__lowerCAmelCase						:	int = 600 ,					__lowerCAmelCase						:	float = 2.0 ,					__lowerCAmelCase						:	float = 3.1 ,					__lowerCAmelCase						:	int = 8 ,					__lowerCAmelCase						:	List[int] = [3, 3, 5, 3, 5, 5, 3] ,					__lowerCAmelCase						:	List[int] = [32, 16, 24, 40, 80, 112, 192] ,					__lowerCAmelCase						:	List[int] = [16, 24, 40, 80, 112, 192, 320] ,					__lowerCAmelCase						:	List[int] = [] ,					__lowerCAmelCase						:	List[int] = [1, 2, 2, 2, 1, 2, 1] ,					__lowerCAmelCase						:	List[int] = [1, 2, 2, 3, 3, 4, 1] ,					__lowerCAmelCase						:	List[int] = [1, 6, 6, 6, 6, 6, 6] ,					__lowerCAmelCase						:	float = 0.25 ,					__lowerCAmelCase						:	str = "swish" ,					__lowerCAmelCase						:	int = 2560 ,					__lowerCAmelCase						:	str = "mean" ,					__lowerCAmelCase						:	float = 0.02 ,					__lowerCAmelCase						:	float = 0.001 ,					__lowerCAmelCase						:	float = 0.99 ,					__lowerCAmelCase						:	float = 0.5 ,					__lowerCAmelCase						:	float = 0.2 ,					**__lowerCAmelCase						:	Optional[Any] ,					):
      super().__init__(**__lowerCAmelCase       )

      _UpperCAmelCase    			=   num_channels
      _UpperCAmelCase    			=   image_size
      _UpperCAmelCase    			=   width_coefficient
      _UpperCAmelCase    			=   depth_coefficient
      _UpperCAmelCase    			=   depth_divisor
      _UpperCAmelCase    			=   kernel_sizes
      _UpperCAmelCase    			=   in_channels
      _UpperCAmelCase    			=   out_channels
      _UpperCAmelCase    			=   depthwise_padding
      _UpperCAmelCase    			=   strides
      _UpperCAmelCase    			=   num_block_repeats
      _UpperCAmelCase    			=   expand_ratios
      _UpperCAmelCase    			=   squeeze_expansion_ratio
      _UpperCAmelCase    			=   hidden_act
      _UpperCAmelCase    			=   hidden_dim
      _UpperCAmelCase    			=   pooling_type
      _UpperCAmelCase    			=   initializer_range
      _UpperCAmelCase    			=   batch_norm_eps
      _UpperCAmelCase    			=   batch_norm_momentum
      _UpperCAmelCase    			=   dropout_rate
      _UpperCAmelCase    			=   drop_connect_rate
      _UpperCAmelCase    			=   sum(__lowerCAmelCase       ) * 4



class 							a					(		lowerCAmelCase_ ):
    _snake_case  :	Union[str, Any]  				=				version.parse('1.11' )


    @property
    def   lowerCAmelCase_	(       self						:	Any       ):
      return OrderedDict(
          [
              ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
          ]       )


    @property
    def   lowerCAmelCase_	(       self						:	List[Any]       ):
      return 1e-5
