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

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

_A   					=    {
    '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 lowerCamelCase		(lowercase__      ):






					'''simple docstring'''


					a   	=		VOCAB_FILES_NAMES
					a   	=		PRETRAINED_VOCAB_FILES_MAP
					a   	=		PRETRAINED_INIT_CONFIGURATION
					a   	=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					a   	=		ElectraTokenizer



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

									SCREAMING_SNAKE_CASE__		  =				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
									):
													SCREAMING_SNAKE_CASE__		  =				getattr(__lowercase   , 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(**__lowercase		)

									SCREAMING_SNAKE_CASE__		  =				do_lower_case



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





"""simple docstring"""






import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


_A   					=    HUGGINGFACE_HUB_CACHE


_A   					=    'config.json'
_A   					=    'diffusion_pytorch_model.bin'
_A   					=    'diffusion_flax_model.msgpack'
_A   					=    'model.onnx'
_A   					=    'diffusion_pytorch_model.safetensors'
_A   					=    'weights.pb'
_A   					=    'https://huggingface.co'
_A   					=    default_cache_path
_A   					=    'diffusers_modules'
_A   					=    os.getenv('HF_MODULES_CACHE', os.path.join(hf_cache_home, 'modules'))
_A   					=    ['fp16', 'non-ema']
_A   					=    '.self_attn'




