



'''simple docstring'''






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


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

UpperCamelCase__:  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 							SCREAMING_SNAKE_CASE(				SCREAMING_SNAKE_CASE__     ):







	"""simple docstring"""






	lowerCamelCase__     					=			"""markuplm"""







	def __init__(		self     :	Optional[int]						,     __snake_case     :	List[str]=30522						,     __snake_case     :	int=768						,     __snake_case     :	Optional[int]=12						,     __snake_case     :	int=12						,     __snake_case     :	List[str]=3072						,     __snake_case     :	Union[str, Any]="gelu"						,     __snake_case     :	List[Any]=0.1						,     __snake_case     :	Any=0.1						,     __snake_case     :	Any=512						,     __snake_case     :	Union[str, Any]=2						,     __snake_case     :	List[str]=0.02						,     __snake_case     :	Union[str, Any]=1E-12						,     __snake_case     :	str=0						,     __snake_case     :	int=0						,     __snake_case     :	Union[str, Any]=2						,     __snake_case     :	Union[str, Any]=256						,     __snake_case     :	int=1024						,     __snake_case     :	List[str]=216						,     __snake_case     :	Dict=1001						,     __snake_case     :	str=32						,     __snake_case     :	Dict=50						,     __snake_case     :	str="absolute"						,     __snake_case     :	Union[str, Any]=True						,     __snake_case     :	Optional[Any]=None						,     **__snake_case     :	str						,     )     ->						List[Any]:
								super().__init__(
								    pad_token_id=__snake_case						,     bos_token_id=__snake_case						,     eos_token_id=__snake_case						,     **__snake_case						,     )
								UpperCAmelCase					:			Any									=						vocab_size
								UpperCAmelCase					:			int									=						hidden_size
								UpperCAmelCase					:			List[str]									=						num_hidden_layers
								UpperCAmelCase					:			Tuple									=						num_attention_heads
								UpperCAmelCase					:			Union[str, Any]									=						hidden_act
								UpperCAmelCase					:			Tuple									=						intermediate_size
								UpperCAmelCase					:			List[Any]									=						hidden_dropout_prob
								UpperCAmelCase					:			Tuple									=						attention_probs_dropout_prob
								UpperCAmelCase					:			List[str]									=						max_position_embeddings
								UpperCAmelCase					:			str									=						type_vocab_size
								UpperCAmelCase					:			Tuple									=						initializer_range
								UpperCAmelCase					:			List[str]									=						layer_norm_eps
								UpperCAmelCase					:			List[str]									=						position_embedding_type
								UpperCAmelCase					:			str									=						use_cache
								UpperCAmelCase					:			Optional[int]									=						classifier_dropout
								# additional properties
								UpperCAmelCase					:			Tuple									=						max_depth
								UpperCAmelCase					:			Optional[int]									=						max_xpath_tag_unit_embeddings
								UpperCAmelCase					:			str									=						max_xpath_subs_unit_embeddings
								UpperCAmelCase					:			Optional[int]									=						tag_pad_id
								UpperCAmelCase					:			List[Any]									=						subs_pad_id
								UpperCAmelCase					:			Dict									=						xpath_unit_hidden_size











from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
				import accelerate

def lowercase    (  SCREAMING_SNAKE_CASE )			->							Union[str, Any]:


			'''simple docstring'''







			if not is_accelerate_available():
						return method
			SCREAMING_SNAKE_CASE_								=						version.parse(accelerate.__version__ ).base_version
			if version.parse(SCREAMING_SNAKE_CASE ) < version.parse('0.17.0' ):
						return method

			def wrapper(self       ,    *SCREAMING_SNAKE_CASE       ,    **SCREAMING_SNAKE_CASE ):
						if hasattr(self       ,    '_hf_hook' ) and hasattr(self._hf_hook       ,    'pre_forward' ):
									self._hf_hook.pre_forward(self )
						return method(self       ,    *SCREAMING_SNAKE_CASE       ,    **SCREAMING_SNAKE_CASE )

			return wrapper
