

'''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			:				Optional[int] 			=					{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

lowerCamelCase			:				List[Any] 			=					{
    "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			:				Dict 			=					{
    "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__  ):
  A__					=    VOCAB_FILES_NAMES
  A__					=    PRETRAINED_VOCAB_FILES_MAP
  A__					=    PRETRAINED_INIT_CONFIGURATION
  A__					=    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  A__					=    ElectraTokenizer





  def __init__(		self				:     Union[str, Any]							, _a				:     Union[str, Any]=None							, _a				:     str=None							, _a				:     Optional[int]=True							, _a				:     Any="[UNK]"							, _a				:     Any="[SEP]"							, _a				:     List[Any]="[PAD]"							, _a				:     str="[CLS]"							, _a				:     Optional[int]="[MASK]"							, _a				:     Optional[Any]=True							, _a				:     Dict=None							, **_a				:     Any							, )     ->   List[Any]:





       '''simple docstring'''






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

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

       _SCREAMING_SNAKE_CASE							   =do_lower_case





  def 						A  (		self				:     Tuple							, _a				:     Optional[int]							, _a				:     str=None			)     ->   Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =[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[Any]							, _a				:     List[int]							, _a				:     Optional[List[int]] = None			)     ->   List[int]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =[self.sep_token_id]
       _SCREAMING_SNAKE_CASE							   =[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				:     Optional[Any]							, _a				:     str							, _a				:     Optional[str] = None			)     ->   Tuple[str]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =self._tokenizer.model.save(_a							, name=_a			)
       return tuple(_a			)



'''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			:				Any 			=					logging.get_logger(__name__)

lowerCamelCase			:				int 			=					{
    "facebook/data2vec-vision-base-ft": (
        "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"
    ),
}







class 							A__   (	A__  ):
  A__					=    'data2vec-vision'





  def __init__(		self				:     str							, _a				:     Optional[int]=768							, _a				:     List[str]=12							, _a				:     Any=12							, _a				:     Tuple=3072							, _a				:     Optional[Any]="gelu"							, _a				:     Tuple=0.0							, _a				:     str=0.0							, _a				:     Dict=0.02							, _a				:     int=1e-12							, _a				:     List[str]=224							, _a				:     str=16							, _a				:     Dict=3							, _a				:     int=False							, _a				:     List[str]=False							, _a				:     str=False							, _a				:     str=False							, _a				:     Optional[int]=0.1							, _a				:     List[str]=0.1							, _a				:     Dict=True							, _a				:     str=[3, 5, 7, 11]							, _a				:     List[Any]=[1, 2, 3, 6]							, _a				:     Any=True							, _a				:     Optional[Any]=0.4							, _a				:     str=256							, _a				:     Dict=1							, _a				:     List[str]=False							, _a				:     List[Any]=255							, **_a				:     Any							, )     ->   Optional[Any]:





       '''simple docstring'''






       super().__init__(**_a			)

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

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







class 							A__   (	A__  ):
  A__					=    version.parse('1.11'  )





  @property
  def 						A  (		self				:     str			)     ->   Mapping[str, Mapping[int, str]]:





       '''simple docstring'''






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





  @property
  def 						A  (		self				:     List[Any]			)     ->   float:





       '''simple docstring'''






       return 1e-4
