"""simple docstring"""


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_electra import ElectraTokenizer


lowerCAmelCase_:					Union[str, Any]        =					{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

lowerCAmelCase_:					List[str]        =					{
    "vocab_file": {
        "google/electra-small-generator": (
            "https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt"
        ),
        "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt",
        "google/electra-large-generator": (
            "https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt"
        ),
        "google/electra-small-discriminator": (
            "https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt"
        ),
        "google/electra-base-discriminator": (
            "https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt"
        ),
        "google/electra-large-discriminator": (
            "https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt"
        ),
    },
    "tokenizer_file": {
        "google/electra-small-generator": (
            "https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-base-generator": (
            "https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-large-generator": (
            "https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json"
        ),
        "google/electra-small-discriminator": (
            "https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json"
        ),
        "google/electra-base-discriminator": (
            "https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json"
        ),
        "google/electra-large-discriminator": (
            "https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json"
        ),
    },
}

lowerCAmelCase_:					str        =					{
    "google/electra-small-generator": 5_1_2,
    "google/electra-base-generator": 5_1_2,
    "google/electra-large-generator": 5_1_2,
    "google/electra-small-discriminator": 5_1_2,
    "google/electra-base-discriminator": 5_1_2,
    "google/electra-large-discriminator": 5_1_2,
}

lowerCAmelCase_:					List[str]        =					{
    "google/electra-small-generator": {"do_lower_case": True},
    "google/electra-base-generator": {"do_lower_case": True},
    "google/electra-large-generator": {"do_lower_case": True},
    "google/electra-small-discriminator": {"do_lower_case": True},
    "google/electra-base-discriminator": {"do_lower_case": True},
    "google/electra-large-discriminator": {"do_lower_case": True},
}






class    a__    (   _a	):
   snake_case_							=      VOCAB_FILES_NAMES
   snake_case_							=      PRETRAINED_VOCAB_FILES_MAP
   snake_case_							=      PRETRAINED_INIT_CONFIGURATION
   snake_case_							=      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   snake_case_							=      ElectraTokenizer


   def __init__(     self,				_UpperCAmelCase=None,				_UpperCAmelCase=None,				_UpperCAmelCase=True,				_UpperCAmelCase="[UNK]",				_UpperCAmelCase="[SEP]",				_UpperCAmelCase="[PAD]",				_UpperCAmelCase="[CLS]",				_UpperCAmelCase="[MASK]",				_UpperCAmelCase=True,				_UpperCAmelCase=None,				**_UpperCAmelCase,				):
        '''simple docstring'''



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

        lowercase__				 =							json.loads(self.backend_tokenizer.normalizer.__getstate__()  )
        if (
            normalizer_state.get("lowercase",				_UpperCAmelCase  ) != do_lower_case
            or normalizer_state.get("strip_accents",				_UpperCAmelCase  ) != strip_accents
            or normalizer_state.get("handle_chinese_chars",				_UpperCAmelCase  ) != tokenize_chinese_chars
        ):
             lowercase__				 =							getattr(_UpperCAmelCase,				normalizer_state.pop("type"  )  )
             lowercase__				 =							do_lower_case
             lowercase__				 =							strip_accents
             lowercase__				 =							tokenize_chinese_chars
             lowercase__				 =							normalizer_class(**_UpperCAmelCase  )

        lowercase__				 =							do_lower_case


   def 	snake_case__	(     self,				_UpperCAmelCase,				_UpperCAmelCase=None  ):
        '''simple docstring'''



        lowercase__				 =							[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,				_UpperCAmelCase,				_UpperCAmelCase = None  ):
        '''simple docstring'''



        lowercase__				 =							[self.sep_token_id]
        lowercase__				 =							[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,				_UpperCAmelCase,				_UpperCAmelCase = None  ):
        '''simple docstring'''



        lowercase__				 =							self._tokenizer.model.save(_UpperCAmelCase,				name=_UpperCAmelCase  )
        return tuple(_UpperCAmelCase  )





"""simple docstring"""


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


lowerCAmelCase_:					str     =					logging.get_logger(__name__)

lowerCAmelCase_:					List[Any]     =					{
    "facebook/data2vec-vision-base-ft": (
        "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"
    ),
}






class    a__    (   _a	):
   snake_case_							=      "data2vec-vision"


   def __init__(     self,				_UpperCAmelCase=768,				_UpperCAmelCase=12,				_UpperCAmelCase=12,				_UpperCAmelCase=3072,				_UpperCAmelCase="gelu",				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.02,				_UpperCAmelCase=1E-12,				_UpperCAmelCase=224,				_UpperCAmelCase=16,				_UpperCAmelCase=3,				_UpperCAmelCase=False,				_UpperCAmelCase=False,				_UpperCAmelCase=False,				_UpperCAmelCase=False,				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.1,				_UpperCAmelCase=True,				_UpperCAmelCase=[3, 5, 7, 11],				_UpperCAmelCase=[1, 2, 3, 6],				_UpperCAmelCase=True,				_UpperCAmelCase=0.4,				_UpperCAmelCase=256,				_UpperCAmelCase=1,				_UpperCAmelCase=False,				_UpperCAmelCase=255,				**_UpperCAmelCase,				):
        '''simple docstring'''



        super().__init__(**_UpperCAmelCase  )

        lowercase__				 =							hidden_size
        lowercase__				 =							num_hidden_layers
        lowercase__				 =							num_attention_heads
        lowercase__				 =							intermediate_size
        lowercase__				 =							hidden_act
        lowercase__				 =							hidden_dropout_prob
        lowercase__				 =							attention_probs_dropout_prob
        lowercase__				 =							initializer_range
        lowercase__				 =							layer_norm_eps

        lowercase__				 =							image_size
        lowercase__				 =							patch_size
        lowercase__				 =							num_channels
        lowercase__				 =							use_mask_token
        lowercase__				 =							use_absolute_position_embeddings
        lowercase__				 =							use_relative_position_bias
        lowercase__				 =							use_shared_relative_position_bias
        lowercase__				 =							layer_scale_init_value
        lowercase__				 =							drop_path_rate
        lowercase__				 =							use_mean_pooling
        # decode head attributes (semantic segmentation)
        lowercase__				 =							out_indices
        lowercase__				 =							pool_scales
        # auxiliary head attributes (semantic segmentation)
        lowercase__				 =							use_auxiliary_head
        lowercase__				 =							auxiliary_loss_weight
        lowercase__				 =							auxiliary_channels
        lowercase__				 =							auxiliary_num_convs
        lowercase__				 =							auxiliary_concat_input
        lowercase__				 =							semantic_loss_ignore_index






class    a__    (   _a	):
   snake_case_							=      version.parse("1.11"	)


   @property
   def 	snake_case__	(     self  ):
        '''simple docstring'''



        return OrderedDict(
            [
                ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
            ]  )


   @property
   def 	snake_case__	(     self  ):
        '''simple docstring'''



        return 1E-4




