





'''simple docstring'''


from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCamelCase					:						List[Any]					     =							logging.get_logger(__name__)

_lowerCamelCase					:						Optional[int]					     =							{
    'google/reformer-crime-and-punishment': (
        'https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json'
    ),
    'google/reformer-enwik8': 'https://huggingface.co/google/reformer-enwik8/resolve/main/config.json',
}



class 				__UpperCAmelCase	(							A__    ):







		'''simple docstring'''







		__lowerCAmelCase								=     '''reformer'''
		__lowerCAmelCase								=     ['''past_buckets_states''']
		__lowerCAmelCase								=     {}







		def __init__(self    :   Optional[int]   ,   _lowerCAmelCase    :   Optional[int]=64   ,   _lowerCAmelCase    :   List[Any]=["local", "lsh", "local", "lsh", "local", "lsh"]   ,   _lowerCAmelCase    :   List[Any]=1.0   ,   _lowerCAmelCase    :   List[str]=True   ,   _lowerCAmelCase    :   Any=[64, 64]   ,   _lowerCAmelCase    :   str=[64, 192]   ,   _lowerCAmelCase    :   Tuple=0   ,   _lowerCAmelCase    :   Tuple=2   ,   _lowerCAmelCase    :   List[str]=512   ,   _lowerCAmelCase    :   List[str]=None   ,   _lowerCAmelCase    :   List[str]="relu"   ,   _lowerCAmelCase    :   Any=0.05   ,   _lowerCAmelCase    :   List[Any]=256   ,   _lowerCAmelCase    :   Optional[Any]=0.02   ,   _lowerCAmelCase    :   Any=False   ,   _lowerCAmelCase    :   Dict=1e-12   ,   _lowerCAmelCase    :   List[Any]=1   ,   _lowerCAmelCase    :   Union[str, Any]=0   ,   _lowerCAmelCase    :   Optional[int]=0.05   ,   _lowerCAmelCase    :   Any=64   ,   _lowerCAmelCase    :   str=64   ,   _lowerCAmelCase    :   Tuple=0.0   ,   _lowerCAmelCase    :   List[Any]=1   ,   _lowerCAmelCase    :   Optional[Any]=0   ,   _lowerCAmelCase    :   Optional[Any]=4096   ,   _lowerCAmelCase    :   List[str]=12   ,   _lowerCAmelCase    :   Any=None   ,   _lowerCAmelCase    :   Union[str, Any]=1   ,   _lowerCAmelCase    :   int=0   ,   _lowerCAmelCase    :   Union[str, Any]=320   ,   _lowerCAmelCase    :   Optional[int]=False   ,   _lowerCAmelCase    :   Optional[Any]=True   ,   _lowerCAmelCase    :   List[str]=None   ,   **_lowerCAmelCase    :   Optional[Any]   ,   ):
			A					=   hash_seed
			A					=   vocab_size
			A					=   attention_head_size
			A					=   hidden_size
			A					=   num_attention_heads
			A					=   num_hashes
			A					=   len(_lowerCAmelCase   )
			A					=   tuple(_lowerCAmelCase   ) if isinstance(_lowerCAmelCase   ,   _lowerCAmelCase   ) else num_buckets
			A					=   lsh_attn_chunk_length
			A					=   local_attn_chunk_length
			A					=   lsh_num_chunks_after
			A					=   lsh_num_chunks_before
			A					=   local_num_chunks_after
			A					=   local_num_chunks_before
			A					=   hidden_act
			A					=   feed_forward_size
			A					=   hidden_dropout_prob
			A					=   lsh_attention_probs_dropout_prob
			A					=   local_attention_probs_dropout_prob
			A					=   max_position_embeddings
			A					=   initializer_range
			A					=   layer_norm_eps
			A					=   axial_pos_embds
			A					=   tuple(_lowerCAmelCase   )
			A					=   tuple(_lowerCAmelCase   )
			A					=   axial_norm_std
			A					=   chunk_size_lm_head
			A					=   attn_layers
			A					=   use_cache
			A					=   classifier_dropout
			super().__init__(
			    pad_token_id=_lowerCAmelCase   ,   eos_token_id=_lowerCAmelCase   ,   is_decoder=_lowerCAmelCase   ,   tie_word_embeddings=_lowerCAmelCase   ,   **_lowerCAmelCase   ,   )








'''simple docstring'''


from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


_lowerCamelCase					:						str					     =							{
    'configuration_ernie_m': ['ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ErnieMConfig'],
}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						List[str]					     =							['ErnieMTokenizer']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						Union[str, Any]					     =							[
				    'ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'ErnieMForMultipleChoice',
				    'ErnieMForQuestionAnswering',
				    'ErnieMForSequenceClassification',
				    'ErnieMForTokenClassification',
				    'ErnieMModel',
				    'ErnieMPreTrainedModel',
				    'ErnieMForInformationExtraction',
				]


if TYPE_CHECKING:
				from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig

				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_ernie_m import ErnieMTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_ernie_m import (
								    ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST,
								    ErnieMForInformationExtraction,
								    ErnieMForMultipleChoice,
								    ErnieMForQuestionAnswering,
								    ErnieMForSequenceClassification,
								    ErnieMForTokenClassification,
								    ErnieMModel,
								    ErnieMPreTrainedModel,
								)


else:
				import sys

				_lowerCamelCase					:						int					     =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

