


"""simple docstring"""



import copy

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


__snake_case         =					logging.get_logger(__name__)







class _lowerCAmelCase       (   snake_case_			):
   __UpperCAmelCase				: Optional[int]													=						'''encoder-decoder'''
   __UpperCAmelCase				: List[str]													=						True







   def __init__(			self		,			**UpperCamelCase__		)			->	Optional[int]:

       '''simple docstring'''




       super().__init__(**UpperCamelCase__		)
       assert (
           "encoder" in kwargs and "decoder" in kwargs
       ), "Config has to be initialized with encoder and decoder config"
       snake_case					:   Optional[Any]         =					kwargs.pop("encoder"		)
       snake_case					:   Union[str, Any]         =					encoder_config.pop("model_type"		)
       snake_case					:   str         =					kwargs.pop("decoder"		)
       snake_case					:   Dict         =					decoder_config.pop("model_type"		)

       from ..auto.configuration_auto import AutoConfig

       snake_case					:   Optional[int]         =					AutoConfig.for_model(UpperCamelCase__		,			**UpperCamelCase__		)
       snake_case					:   Dict         =					AutoConfig.for_model(UpperCamelCase__		,			**UpperCamelCase__		)
       snake_case					:   Optional[int]         =					True







   @classmethod
   def 				lowerCamelCase	(			cls		,			UpperCamelCase__		,			UpperCamelCase__		,			**UpperCamelCase__		)			->	PretrainedConfig:

       '''simple docstring'''




       logger.info("Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"		)
       snake_case					:   Dict         =					True
       snake_case					:   List[str]         =					True

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







   def 				lowerCamelCase	(			self		)			->	str:

       '''simple docstring'''




       snake_case					:   Tuple         =					copy.deepcopy(self.__dict__		)
       snake_case					:   Union[str, Any]         =					self.encoder.to_dict()
       snake_case					:   Optional[int]         =					self.decoder.to_dict()
       snake_case					:   str         =					self.__class__.model_type
       return output









"""simple docstring"""



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


__snake_case         =					logging.get_logger(__name__)

__snake_case         =					{
    """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       (   snake_case_			):
   __UpperCAmelCase				: Tuple													=						'''markuplm'''







   def __init__(			self		,			UpperCamelCase__=3_0522		,			UpperCamelCase__=768		,			UpperCamelCase__=12		,			UpperCamelCase__=12		,			UpperCamelCase__=3072		,			UpperCamelCase__="gelu"		,			UpperCamelCase__=0.1		,			UpperCamelCase__=0.1		,			UpperCamelCase__=512		,			UpperCamelCase__=2		,			UpperCamelCase__=0.02		,			UpperCamelCase__=1e-12		,			UpperCamelCase__=0		,			UpperCamelCase__=0		,			UpperCamelCase__=2		,			UpperCamelCase__=256		,			UpperCamelCase__=1024		,			UpperCamelCase__=216		,			UpperCamelCase__=1001		,			UpperCamelCase__=32		,			UpperCamelCase__=50		,			UpperCamelCase__="absolute"		,			UpperCamelCase__=True		,			UpperCamelCase__=None		,			**UpperCamelCase__		,			)			->	Any:

       '''simple docstring'''




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





