from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCamelCase			 =	logging.get_logger(__name__)

UpperCamelCase			 =	{
    'nghuyong/ernie-1.0-base-zh': 'https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-2.0-base-en': 'https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json',
    'nghuyong/ernie-2.0-large-en': 'https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json',
    'nghuyong/ernie-3.0-base-zh': 'https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-medium-zh': 'https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-mini-zh': 'https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-micro-zh': 'https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-nano-zh': 'https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json',
    'nghuyong/ernie-gram-zh': 'https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json',
    'nghuyong/ernie-health-zh': 'https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json',
}


class _a   (       __SCREAMING_SNAKE_CASE					):

	'''simple docstring'''



	lowerCamelCase_    :			Union[str, Any]	  =       """ernie"""

	def __init__(   self							, __UpperCAmelCase=30_522							, __UpperCAmelCase=768							, __UpperCAmelCase=12							, __UpperCAmelCase=12							, __UpperCAmelCase=3_072							, __UpperCAmelCase="gelu"							, __UpperCAmelCase=0.1							, __UpperCAmelCase=0.1							, __UpperCAmelCase=512							, __UpperCAmelCase=2							, __UpperCAmelCase=3							, __UpperCAmelCase=False							, __UpperCAmelCase=0.02							, __UpperCAmelCase=1e-12							, __UpperCAmelCase=0							, __UpperCAmelCase="absolute"							, __UpperCAmelCase=True							, __UpperCAmelCase=None							, **__UpperCAmelCase							, ):
			super().__init__(pad_token_id=lowerCAmelCase__							, **lowerCAmelCase__    )

			__A							:    Union[str, Any]         =      vocab_size
			__A							:    Optional[int]         =      hidden_size
			__A							:    Optional[Any]         =      num_hidden_layers
			__A							:    Any         =      num_attention_heads
			__A							:    Dict         =      hidden_act
			__A							:    List[Any]         =      intermediate_size
			__A							:    Tuple         =      hidden_dropout_prob
			__A							:    Optional[int]         =      attention_probs_dropout_prob
			__A							:    Optional[int]         =      max_position_embeddings
			__A							:    Optional[Any]         =      type_vocab_size
			__A							:    Tuple         =      task_type_vocab_size
			__A							:    List[Any]         =      use_task_id
			__A							:    str         =      initializer_range
			__A							:    List[Any]         =      layer_norm_eps
			__A							:    str         =      position_embedding_type
			__A							:    str         =      use_cache
			__A							:    Optional[int]         =      classifier_dropout


class _a   (       __SCREAMING_SNAKE_CASE					):

	'''simple docstring'''



	@property
	def      __UpperCAmelCase(   self    ):




			if self.task == "multiple-choice":
					__A							:    Optional[Any]         =      {0: 'batch', 1: 'choice', 2: 'sequence'}
			else:
					__A							:    List[str]         =      {0: 'batch', 1: 'sequence'}
			return OrderedDict(
			    [
			        ("input_ids", dynamic_axis),
			        ("attention_mask", dynamic_axis),
			        ("token_type_ids", dynamic_axis),
			        ("task_type_ids", dynamic_axis),
			    ]    )









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


lowerCAmelCase__       :	Any     				=logging.get_logger(__name__)

lowerCAmelCase__       :	Union[str, Any]     				={
    '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      __lowercase  (__SCREAMING_SNAKE_CASE   ):





							"""simple docstring"""







							_UpperCAmelCase     =		"""reformer"""
							_UpperCAmelCase     =		["""past_buckets_states"""]
							_UpperCAmelCase     =		{}






							def __init__(	self       ,		lowerCAmelCase__=6_4       ,		lowerCAmelCase__=["local", "lsh", "local", "lsh", "local", "lsh"]       ,		lowerCAmelCase__=1.0       ,		lowerCAmelCase__=True       ,		lowerCAmelCase__=[6_4, 6_4]       ,		lowerCAmelCase__=[6_4, 1_9_2]       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__=2       ,		lowerCAmelCase__=5_1_2       ,		lowerCAmelCase__=None       ,		lowerCAmelCase__="relu"       ,		lowerCAmelCase__=0.05       ,		lowerCAmelCase__=2_5_6       ,		lowerCAmelCase__=0.02       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=1E-12       ,		lowerCAmelCase__=1       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__=0.05       ,		lowerCAmelCase__=6_4       ,		lowerCAmelCase__=6_4       ,		lowerCAmelCase__=0.0       ,		lowerCAmelCase__=1       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__=4_0_9_6       ,		lowerCAmelCase__=1_2       ,		lowerCAmelCase__=None       ,		lowerCAmelCase__=1       ,		lowerCAmelCase__=0       ,		lowerCAmelCase__=3_2_0       ,		lowerCAmelCase__=False       ,		lowerCAmelCase__=True       ,		lowerCAmelCase__=None       ,		**lowerCAmelCase__       ,		):





										"""simple docstring"""




										SCREAMING_SNAKE_CASE_						:			str       						= hash_seed
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= vocab_size
										SCREAMING_SNAKE_CASE_						:			Any       						= attention_head_size
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= hidden_size
										SCREAMING_SNAKE_CASE_						:			Optional[Any]       						= num_attention_heads
										SCREAMING_SNAKE_CASE_						:			Any       						= num_hashes
										SCREAMING_SNAKE_CASE_						:			int       						= len(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			str       						= tuple(lowerCAmelCase__    ) if isinstance(lowerCAmelCase__       ,		lowerCAmelCase__    ) else num_buckets
										SCREAMING_SNAKE_CASE_						:			int       						= lsh_attn_chunk_length
										SCREAMING_SNAKE_CASE_						:			List[str]       						= local_attn_chunk_length
										SCREAMING_SNAKE_CASE_						:			Tuple       						= lsh_num_chunks_after
										SCREAMING_SNAKE_CASE_						:			str       						= lsh_num_chunks_before
										SCREAMING_SNAKE_CASE_						:			List[Any]       						= local_num_chunks_after
										SCREAMING_SNAKE_CASE_						:			Any       						= local_num_chunks_before
										SCREAMING_SNAKE_CASE_						:			Any       						= hidden_act
										SCREAMING_SNAKE_CASE_						:			Dict       						= feed_forward_size
										SCREAMING_SNAKE_CASE_						:			Optional[int]       						= hidden_dropout_prob
										SCREAMING_SNAKE_CASE_						:			Tuple       						= lsh_attention_probs_dropout_prob
										SCREAMING_SNAKE_CASE_						:			Any       						= local_attention_probs_dropout_prob
										SCREAMING_SNAKE_CASE_						:			str       						= max_position_embeddings
										SCREAMING_SNAKE_CASE_						:			Optional[int]       						= initializer_range
										SCREAMING_SNAKE_CASE_						:			Optional[Any]       						= layer_norm_eps
										SCREAMING_SNAKE_CASE_						:			List[str]       						= axial_pos_embds
										SCREAMING_SNAKE_CASE_						:			List[str]       						= tuple(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			Tuple       						= tuple(lowerCAmelCase__    )
										SCREAMING_SNAKE_CASE_						:			Dict       						= axial_norm_std
										SCREAMING_SNAKE_CASE_						:			Any       						= chunk_size_lm_head
										SCREAMING_SNAKE_CASE_						:			int       						= attn_layers
										SCREAMING_SNAKE_CASE_						:			Union[str, Any]       						= use_cache
										SCREAMING_SNAKE_CASE_						:			Tuple       						= classifier_dropout
										super().__init__(
										    pad_token_id=lowerCAmelCase__       ,		eos_token_id=lowerCAmelCase__       ,		is_decoder=lowerCAmelCase__       ,		tie_word_embeddings=lowerCAmelCase__       ,		**lowerCAmelCase__       ,		)





