



'''simple docstring'''

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


_A				:    List[str]     						=logging.get_logger(__name__)

_A				:    Optional[int]     						={
    'facebook/nllb-moe-54B': 'https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json',
}



class 		lowerCamelCase__      (						UpperCamelCase_     ):




					'''simple docstring'''



					A_						    =						"""nllb-moe"""
					A_						    =						["""past_key_values"""]
					A_						    =						{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




					def __init__(  self				:	str     ,  UpperCamelCase_				:	Any=12_8112     ,  UpperCamelCase_				:	Dict=1024     ,  UpperCamelCase_				:	str=12     ,  UpperCamelCase_				:	List[Any]=4096     ,  UpperCamelCase_				:	Any=16     ,  UpperCamelCase_				:	Dict=12     ,  UpperCamelCase_				:	Dict=4096     ,  UpperCamelCase_				:	List[Any]=16     ,  UpperCamelCase_				:	List[str]=0.05     ,  UpperCamelCase_				:	Optional[int]=0.05     ,  UpperCamelCase_				:	Optional[int]=True     ,  UpperCamelCase_				:	Optional[int]=True     ,  UpperCamelCase_				:	List[str]="relu"     ,  UpperCamelCase_				:	Union[str, Any]=1024     ,  UpperCamelCase_				:	Optional[Any]=0.1     ,  UpperCamelCase_				:	Tuple=0.1     ,  UpperCamelCase_				:	Optional[int]=0.0     ,  UpperCamelCase_				:	List[Any]=0.02     ,  UpperCamelCase_				:	Tuple=2     ,  UpperCamelCase_				:	Union[str, Any]=True     ,  UpperCamelCase_				:	Optional[int]=False     ,  UpperCamelCase_				:	List[Any]="float32"     ,  UpperCamelCase_				:	Optional[Any]=False     ,  UpperCamelCase_				:	int=128     ,  UpperCamelCase_				:	List[str]=64     ,  UpperCamelCase_				:	int=4     ,  UpperCamelCase_				:	List[Any]=4     ,  UpperCamelCase_				:	Tuple=0.0_01     ,  UpperCamelCase_				:	Dict=0.0_01     ,  UpperCamelCase_				:	List[Any]="all"     ,  UpperCamelCase_				:	Dict=False     ,  UpperCamelCase_				:	Union[str, Any]=False     ,  UpperCamelCase_				:	Optional[Any]=1.0     ,  UpperCamelCase_				:	List[Any]=0.2     ,  UpperCamelCase_				:	str=1     ,  UpperCamelCase_				:	Union[str, Any]=0     ,  UpperCamelCase_				:	Optional[Any]=2     ,  UpperCamelCase_				:	Optional[Any]=False     ,  **UpperCamelCase_				:	Dict     ,  )  ->       Any:



						'''simple docstring'''





						_lowercase					:       List[Any]       =		vocab_size
						_lowercase					:       int       =		max_position_embeddings
						_lowercase					:       Dict       =		d_model
						_lowercase					:       Optional[int]       =		encoder_ffn_dim
						_lowercase					:       int       =		encoder_layers
						_lowercase					:       Union[str, Any]       =		encoder_attention_heads
						_lowercase					:       List[Any]       =		decoder_ffn_dim
						_lowercase					:       Tuple       =		decoder_layers
						_lowercase					:       int       =		decoder_attention_heads
						_lowercase					:       List[str]       =		dropout
						_lowercase					:       List[Any]       =		attention_dropout
						_lowercase					:       Dict       =		activation_dropout
						_lowercase					:       Any       =		activation_function
						_lowercase					:       Dict       =		init_std
						_lowercase					:       int       =		encoder_layerdrop
						_lowercase					:       str       =		decoder_layerdrop
						_lowercase					:       Optional[Any]       =		use_cache
						_lowercase					:       List[str]       =		encoder_layers
						_lowercase					:       Any       =		scale_embedding  # scale factor will be sqrt(d_model) if True
						_lowercase					:       List[str]       =		router_z_loss_coef
						_lowercase					:       int       =		router_aux_loss_coef
						_lowercase					:       List[Any]       =		decoder_sparse_step
						_lowercase					:       List[Any]       =		encoder_sparse_step
						_lowercase					:       List[str]       =		num_experts
						_lowercase					:       Any       =		expert_capacity
						_lowercase					:       Dict       =		router_bias
						if router_dtype not in ["float32", "float16", "bfloat16"]:
							raise ValueError(F'''`router_dtype` must be one of \'float32\', \'float16\' or \'bfloat16\', got {router_dtype}'''					)
						_lowercase					:       int       =		router_dtype

						_lowercase					:       Optional[Any]       =		router_ignore_padding_tokens
						_lowercase					:       Optional[Any]       =		batch_prioritized_routing
						_lowercase					:       List[str]       =		second_expert_policy
						_lowercase					:       int       =		normalize_router_prob_before_dropping
						_lowercase					:       List[Any]       =		moe_eval_capacity_token_fraction
						_lowercase					:       int       =		moe_token_dropout
						_lowercase					:       List[str]       =		output_router_logits
						super().__init__(
						    pad_token_id=UpperCamelCase_     ,  bos_token_id=UpperCamelCase_     ,  eos_token_id=UpperCamelCase_     ,  is_encoder_decoder=UpperCamelCase_     ,  decoder_start_token_id=UpperCamelCase_     ,  **UpperCamelCase_     ,  )








'''simple docstring'''

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


_A				:    Optional[Any]     						=logging.get_logger(__name__)

_A				:    Optional[int]     						={
    '''microsoft/markuplm-base''': '''https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json''',
    '''microsoft/markuplm-large''': '''https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json''',
}



class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""markuplm"""




					def __init__(  self				:	int     ,  UpperCamelCase_				:	Optional[Any]=3_0522     ,  UpperCamelCase_				:	Optional[Any]=768     ,  UpperCamelCase_				:	Tuple=12     ,  UpperCamelCase_				:	Union[str, Any]=12     ,  UpperCamelCase_				:	Tuple=3072     ,  UpperCamelCase_				:	Union[str, Any]="gelu"     ,  UpperCamelCase_				:	List[Any]=0.1     ,  UpperCamelCase_				:	List[Any]=0.1     ,  UpperCamelCase_				:	Dict=512     ,  UpperCamelCase_				:	Optional[int]=2     ,  UpperCamelCase_				:	Any=0.02     ,  UpperCamelCase_				:	Optional[Any]=1E-12     ,  UpperCamelCase_				:	List[str]=0     ,  UpperCamelCase_				:	Optional[int]=0     ,  UpperCamelCase_				:	Tuple=2     ,  UpperCamelCase_				:	str=256     ,  UpperCamelCase_				:	Optional[Any]=1024     ,  UpperCamelCase_				:	Union[str, Any]=216     ,  UpperCamelCase_				:	int=1001     ,  UpperCamelCase_				:	int=32     ,  UpperCamelCase_				:	int=50     ,  UpperCamelCase_				:	str="absolute"     ,  UpperCamelCase_				:	Union[str, Any]=True     ,  UpperCamelCase_				:	Optional[int]=None     ,  **UpperCamelCase_				:	Any     ,  )  ->       Optional[int]:



						'''simple docstring'''





						super().__init__(
						    pad_token_id=UpperCamelCase_     ,  bos_token_id=UpperCamelCase_     ,  eos_token_id=UpperCamelCase_     ,  **UpperCamelCase_     ,  )
						_lowercase					:       List[Any]       =		vocab_size
						_lowercase					:       Union[str, Any]       =		hidden_size
						_lowercase					:       Dict       =		num_hidden_layers
						_lowercase					:       Optional[Any]       =		num_attention_heads
						_lowercase					:       Dict       =		hidden_act
						_lowercase					:       Optional[Any]       =		intermediate_size
						_lowercase					:       Optional[int]       =		hidden_dropout_prob
						_lowercase					:       Union[str, Any]       =		attention_probs_dropout_prob
						_lowercase					:       Any       =		max_position_embeddings
						_lowercase					:       List[Any]       =		type_vocab_size
						_lowercase					:       Union[str, Any]       =		initializer_range
						_lowercase					:       Optional[int]       =		layer_norm_eps
						_lowercase					:       Optional[Any]       =		position_embedding_type
						_lowercase					:       str       =		use_cache
						_lowercase					:       str       =		classifier_dropout
						# additional properties
						_lowercase					:       int       =		max_depth
						_lowercase					:       Dict       =		max_xpath_tag_unit_embeddings
						_lowercase					:       str       =		max_xpath_subs_unit_embeddings
						_lowercase					:       List[str]       =		tag_pad_id
						_lowercase					:       Optional[int]       =		subs_pad_id
						_lowercase					:       Any       =		xpath_unit_hidden_size
