






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


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

__A	:	int     =     {
    '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'
        ),
    },
}

__A	:	List[Any]     =     {
    'google/electra-small-generator': 512,
    'google/electra-base-generator': 512,
    'google/electra-large-generator': 512,
    'google/electra-small-discriminator': 512,
    'google/electra-base-discriminator': 512,
    'google/electra-large-discriminator': 512,
}

__A	:	int     =     {
    '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 						__UpperCamelCase	(						lowercase__							):
							lowercase			:		Optional[Any]   		=  VOCAB_FILES_NAMES
							lowercase			:		Dict   		=  PRETRAINED_VOCAB_FILES_MAP
							lowercase			:		Union[str, Any]   		=  PRETRAINED_INIT_CONFIGURATION
							lowercase			:		Tuple   		=  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							lowercase			:		Union[str, Any]   		=  ElectraTokenizer





							def __init__(  self		:int  ,_UpperCamelCase		:Union[str, Any]=None  ,_UpperCamelCase		:Any=None  ,_UpperCamelCase		:int=True  ,_UpperCamelCase		:Tuple="[UNK]"  ,_UpperCamelCase		:List[str]="[SEP]"  ,_UpperCamelCase		:Union[str, Any]="[PAD]"  ,_UpperCamelCase		:List[str]="[CLS]"  ,_UpperCamelCase		:Union[str, Any]="[MASK]"  ,_UpperCamelCase		:Optional[Any]=True  ,_UpperCamelCase		:Tuple=None  ,**_UpperCamelCase		:Dict  ,):
									super().__init__(
									    __lowercase  ,tokenizer_file=__lowercase  ,do_lower_case=__lowercase  ,unk_token=__lowercase  ,sep_token=__lowercase  ,pad_token=__lowercase  ,cls_token=__lowercase  ,mask_token=__lowercase  ,tokenize_chinese_chars=__lowercase  ,strip_accents=__lowercase  ,**__lowercase  ,)

									snake_case_		:							List[str]			       =						json.loads(self.backend_tokenizer.normalizer.__getstate__()			)
									if (
									    normalizer_state.get("""lowercase"""  ,__lowercase			) != do_lower_case
									    or normalizer_state.get("""strip_accents"""  ,__lowercase			) != strip_accents
									    or normalizer_state.get("""handle_chinese_chars"""  ,__lowercase			) != tokenize_chinese_chars
									):
											snake_case_		:							List[Any]			       =						getattr(__lowercase  ,normalizer_state.pop("""type"""			)			)
											snake_case_		:							Union[str, Any]			       =						do_lower_case
											snake_case_		:							List[Any]			       =						strip_accents
											snake_case_		:							List[Any]			       =						tokenize_chinese_chars
											snake_case_		:							str			       =						normalizer_class(**__lowercase			)

									snake_case_		:							Optional[int]			       =						do_lower_case





							def 		a__   (  self		:Optional[Any]  ,_UpperCamelCase		:Optional[int]  ,_UpperCamelCase		:Any=None			):
									snake_case_		:							Dict			       =						[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		:int  ,_UpperCamelCase		:List[int]  ,_UpperCamelCase		:Optional[List[int]] = None			):
									snake_case_		:							int			       =						[self.sep_token_id]
									snake_case_		:							List[Any]			       =						[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		:Any  ,_UpperCamelCase		:str  ,_UpperCamelCase		:Optional[str] = None			):
									snake_case_		:							List[Any]			       =						self._tokenizer.model.save(__lowercase  ,name=__lowercase			)
									return tuple(__lowercase			)



'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


__A	:	Tuple     =     {
    'configuration_audio_spectrogram_transformer': [
        'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'ASTConfig',
    ]
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__A	:	Tuple     =     [
							    'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'ASTForAudioClassification',
							    'ASTModel',
							    'ASTPreTrainedModel',
							]

try:
							if not is_speech_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__A	:	int     =     ['ASTFeatureExtractor']

if TYPE_CHECKING:
							from .configuration_audio_spectrogram_transformer import (
							    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    ASTConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_audio_spectrogram_transformer import (
														    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    ASTForAudioClassification,
														    ASTModel,
														    ASTPreTrainedModel,
														)

							try:
														if not is_speech_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
							import sys

							__A	:	Union[str, Any]     =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)