






'''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


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

SCREAMING_SNAKE_CASE__     =       {
    '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'
        ),
    },
}

SCREAMING_SNAKE_CASE__     =       {
    '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,
}

SCREAMING_SNAKE_CASE__     =       {
    '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_						(      lowerCamelCase    ):
  lowercase							=				VOCAB_FILES_NAMES
  lowercase							=				PRETRAINED_VOCAB_FILES_MAP
  lowercase							=				PRETRAINED_INIT_CONFIGURATION
  lowercase							=				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  lowercase							=				ElectraTokenizer

  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      ,		)  ->				List[Any]:



        """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      ,		)

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

        UpperCamelCase      = do_lower_case

  def   A__						(				self      ,		_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE=None				)  ->				List[str]:



        """simple docstring"""






        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   A__						(				self      ,		_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE = None				)  ->				List[int]:



        """simple docstring"""






        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   A__						(				self      ,		_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE = None				)  ->				Tuple[str]:



        """simple docstring"""






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








'''simple docstring'''

import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


SCREAMING_SNAKE_CASE__     =       'scheduler_config.json'






class     a_						(      lowerCamelCase    ):
  lowercase							=				1
  lowercase							=				2
  lowercase							=				3
  lowercase							=				4
  lowercase							=				5
  lowercase							=				6
  lowercase							=				7
  lowercase							=				8
  lowercase							=				9
  lowercase							=				10
  lowercase							=				11
  lowercase							=				12
  lowercase							=				13
  lowercase							=				14






@dataclass
class     a_						(      lowerCamelCase    ):
  lowercase							=				42






class     a_						:
  lowercase							=				SCHEDULER_CONFIG_NAME
  lowercase							=				[]
  lowercase							=				True

  @classmethod
  def   A__						(				cls      ,		_SCREAMING_SNAKE_CASE = None      ,		_SCREAMING_SNAKE_CASE = None      ,		_SCREAMING_SNAKE_CASE=False      ,		**_SCREAMING_SNAKE_CASE      ,		)  ->				Optional[Any]:



        """simple docstring"""






        UpperCamelCase  ,UpperCamelCase  ,UpperCamelCase      = cls.load_config(
            pretrained_model_name_or_path=_SCREAMING_SNAKE_CASE      ,		subfolder=_SCREAMING_SNAKE_CASE      ,		return_unused_kwargs=_SCREAMING_SNAKE_CASE      ,		return_commit_hash=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE      ,		)
        return cls.from_config(_SCREAMING_SNAKE_CASE      ,		return_unused_kwargs=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE				)

  def   A__						(				self      ,		_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE = False      ,		**_SCREAMING_SNAKE_CASE				)  ->				Dict:



        """simple docstring"""






        self.save_config(save_directory=_SCREAMING_SNAKE_CASE      ,		push_to_hub=_SCREAMING_SNAKE_CASE      ,		**_SCREAMING_SNAKE_CASE				)

  @property
  def   A__						(				self				)  ->				Tuple:



        """simple docstring"""






        return self._get_compatibles()


  @classmethod
  def   A__						(				cls				)  ->				List[Any]:



        """simple docstring"""






        UpperCamelCase      = list(set([cls.__name__] + cls._compatibles				)				)
        UpperCamelCase      = importlib.import_module(__name__.split("""."""				)[0]				)
        UpperCamelCase      = [
            getattr(_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE				) for c in compatible_classes_str if hasattr(_SCREAMING_SNAKE_CASE      ,		_SCREAMING_SNAKE_CASE				)
        ]
        return compatible_classes
