



"""simple docstring"""






from ... import PretrainedConfig


lowerCAmelCase__              =							{
    '''sijunhe/nezha-cn-base''': '''https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json''',
}






class 			__snake_case			(      _a):
  snake_case__							:  Tuple         =		NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP
  snake_case__							:  int         =		"""nezha"""




  def __init__(					self	:		List[str]		,   __lowerCAmelCase	:		int=2_1_1_2_8		,   __lowerCAmelCase	:		Union[str, Any]=7_6_8		,   __lowerCAmelCase	:		Tuple=1_2		,   __lowerCAmelCase	:		int=1_2		,   __lowerCAmelCase	:		List[str]=3_0_7_2		,   __lowerCAmelCase	:		Dict="gelu"		,   __lowerCAmelCase	:		Dict=0.1		,   __lowerCAmelCase	:		Dict=0.1		,   __lowerCAmelCase	:		int=5_1_2		,   __lowerCAmelCase	:		int=6_4		,   __lowerCAmelCase	:		Union[str, Any]=2		,   __lowerCAmelCase	:		List[str]=0.02		,   __lowerCAmelCase	:		int=1E-12		,   __lowerCAmelCase	:		Optional[Any]=0.1		,   __lowerCAmelCase	:		str=0		,   __lowerCAmelCase	:		Dict=2		,   __lowerCAmelCase	:		Any=3		,   __lowerCAmelCase	:		Tuple=True		,   **__lowerCAmelCase	:		Tuple		,   ):






         """simple docstring"""






         super().__init__(pad_token_id=__lowerCAmelCase		,   bos_token_id=__lowerCAmelCase		,   eos_token_id=__lowerCAmelCase		,   **__lowerCAmelCase						)

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









import copy

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


UpperCamelCase__           =			logging.get_logger(__name__)

class 							__SCREAMING_SNAKE_CASE       (  _a							):
							snake_case  :   Optional[Any]      =							"""encoder-decoder"""
							snake_case  :   Optional[int]      =							True






							def __init__(    self	,			**__lowerCAmelCase	):
														super().__init__(**__lowerCAmelCase	)
														assert (
														    "encoder" in kwargs and "decoder" in kwargs
														), "Config has to be initialized with encoder and decoder config"
														UpperCamelCase__					  =      kwargs.pop("""encoder"""	)
														UpperCamelCase__					  =      encoder_config.pop("""model_type"""	)
														UpperCamelCase__					  =      kwargs.pop("""decoder"""	)
														UpperCamelCase__					  =      decoder_config.pop("""model_type"""	)

														from ..auto.configuration_auto import AutoConfig

														UpperCamelCase__					  =      AutoConfig.for_model(__lowerCAmelCase	,			**__lowerCAmelCase	)
														UpperCamelCase__					  =      AutoConfig.for_model(__lowerCAmelCase	,			**__lowerCAmelCase	)
														UpperCamelCase__					  =      True






							@classmethod
							def 					_lowerCamelCase		(    cls	,			__lowerCAmelCase	,			__lowerCAmelCase	,			**__lowerCAmelCase	):
														logger.info("""Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"""	)
														UpperCamelCase__					  =      True
														UpperCamelCase__					  =      True

														return cls(encoder=encoder_config.to_dict()	,			decoder=decoder_config.to_dict()	,			**__lowerCAmelCase	)







							def 					_lowerCamelCase		(    self	):
														UpperCamelCase__					  =      copy.deepcopy(self.__dict__	)
														UpperCamelCase__					  =      self.encoder.to_dict()
														UpperCamelCase__					  =      self.decoder.to_dict()
														UpperCamelCase__					  =      self.__class__.model_type
														return output




