



'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_A				:    Any     						={'''configuration_xglm''': ['''XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XGLMConfig''']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    int     						=['''XGLMTokenizer''']

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    Union[str, Any]     						=['''XGLMTokenizerFast''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    List[Any]     						=[
		    '''XGLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''XGLMForCausalLM''',
		    '''XGLMModel''',
		    '''XGLMPreTrainedModel''',
		]


try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    List[str]     						=[
		    '''FlaxXGLMForCausalLM''',
		    '''FlaxXGLMModel''',
		    '''FlaxXGLMPreTrainedModel''',
		]


try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    Optional[Any]     						=[
		    '''TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''TFXGLMForCausalLM''',
		    '''TFXGLMModel''',
		    '''TFXGLMPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_xglm import XGLMTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_xglm_fast import XGLMTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_xglm import FlaxXGLMForCausalLM, FlaxXGLMModel, FlaxXGLMPreTrainedModel

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_xglm import (
				    TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFXGLMForCausalLM,
				    TFXGLMModel,
				    TFXGLMPreTrainedModel,
				)


else:
		import sys

		_A				:    str     						=_LazyModule(__name__, globals()['''__file__'''], _import_structure)





'''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
