



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


__snake_case						:Any      		=     logging.get_logger(__name__)

__snake_case						:Tuple      		=     {
    '''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     _A       (	__UpperCAmelCase    ):
       UpperCamelCase__  :    Optional[int]											=						'''markuplm'''



       def __init__(		self							:     str     ,		__SCREAMING_SNAKE_CASE							:     List[str]=30_522     ,		__SCREAMING_SNAKE_CASE							:     Optional[Any]=768     ,		__SCREAMING_SNAKE_CASE							:     List[Any]=12     ,		__SCREAMING_SNAKE_CASE							:     Dict=12     ,		__SCREAMING_SNAKE_CASE							:     List[Any]=3_072     ,		__SCREAMING_SNAKE_CASE							:     Optional[Any]="gelu"     ,		__SCREAMING_SNAKE_CASE							:     List[Any]=0.1     ,		__SCREAMING_SNAKE_CASE							:     int=0.1     ,		__SCREAMING_SNAKE_CASE							:     Union[str, Any]=512     ,		__SCREAMING_SNAKE_CASE							:     Tuple=2     ,		__SCREAMING_SNAKE_CASE							:     Optional[Any]=0.02     ,		__SCREAMING_SNAKE_CASE							:     Any=1E-12     ,		__SCREAMING_SNAKE_CASE							:     List[str]=0     ,		__SCREAMING_SNAKE_CASE							:     Tuple=0     ,		__SCREAMING_SNAKE_CASE							:     str=2     ,		__SCREAMING_SNAKE_CASE							:     Any=256     ,		__SCREAMING_SNAKE_CASE							:     List[str]=1_024     ,		__SCREAMING_SNAKE_CASE							:     int=216     ,		__SCREAMING_SNAKE_CASE							:     Any=1_001     ,		__SCREAMING_SNAKE_CASE							:     str=32     ,		__SCREAMING_SNAKE_CASE							:     Union[str, Any]=50     ,		__SCREAMING_SNAKE_CASE							:     Optional[int]="absolute"     ,		__SCREAMING_SNAKE_CASE							:     List[Any]=True     ,		__SCREAMING_SNAKE_CASE							:     List[Any]=None     ,		**__SCREAMING_SNAKE_CASE							:     Optional[Any]     ,		):


           '''simple docstring'''

           super().__init__(
               pad_token_id=__SCREAMING_SNAKE_CASE     ,		bos_token_id=__SCREAMING_SNAKE_CASE     ,		eos_token_id=__SCREAMING_SNAKE_CASE     ,		**__SCREAMING_SNAKE_CASE     ,		)
           __a						       =				vocab_size
           __a						       =				hidden_size
           __a						       =				num_hidden_layers
           __a						       =				num_attention_heads
           __a						       =				hidden_act
           __a						       =				intermediate_size
           __a						       =				hidden_dropout_prob
           __a						       =				attention_probs_dropout_prob
           __a						       =				max_position_embeddings
           __a						       =				type_vocab_size
           __a						       =				initializer_range
           __a						       =				layer_norm_eps
           __a						       =				position_embedding_type
           __a						       =				use_cache
           __a						       =				classifier_dropout
           # additional properties
           __a						       =				max_depth
           __a						       =				max_xpath_tag_unit_embeddings
           __a						       =				max_xpath_subs_unit_embeddings
           __a						       =				tag_pad_id
           __a						       =				subs_pad_id
           __a						       =				xpath_unit_hidden_size










from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader

class     _A       (	__UpperCAmelCase    ):



       def __init__(		self							:     Optional[int]     ,		__SCREAMING_SNAKE_CASE							:     NestedDataStructureLike[PathLike]     ,		__SCREAMING_SNAKE_CASE							:     Optional[NamedSplit] = None     ,		__SCREAMING_SNAKE_CASE							:     Optional[Features] = None     ,		__SCREAMING_SNAKE_CASE							:     str = None     ,		__SCREAMING_SNAKE_CASE							:     bool = False     ,		__SCREAMING_SNAKE_CASE							:     bool = False     ,		__SCREAMING_SNAKE_CASE							:     Optional[int] = None     ,		**__SCREAMING_SNAKE_CASE							:     List[str]     ,		):


           '''simple docstring'''

           super().__init__(
               __SCREAMING_SNAKE_CASE     ,		split=__SCREAMING_SNAKE_CASE     ,		features=__SCREAMING_SNAKE_CASE     ,		cache_dir=__SCREAMING_SNAKE_CASE     ,		keep_in_memory=__SCREAMING_SNAKE_CASE     ,		streaming=__SCREAMING_SNAKE_CASE     ,		num_proc=__SCREAMING_SNAKE_CASE     ,		**__SCREAMING_SNAKE_CASE     ,		)
           __a						       =				path_or_paths if isinstance(__SCREAMING_SNAKE_CASE     ,		__SCREAMING_SNAKE_CASE) else {self.split: path_or_paths}
           __a						       =				Text(
               cache_dir=__SCREAMING_SNAKE_CASE     ,		data_files=__SCREAMING_SNAKE_CASE     ,		features=__SCREAMING_SNAKE_CASE     ,		**__SCREAMING_SNAKE_CASE     ,		)





       def 		_lowerCamelCase			(		self							:     List[str]):


           '''simple docstring'''

           if self.streaming:
               __a						       =				self.builder.as_streaming_dataset(split=self.split)
           # Build regular (map-style) dataset
           else:
               __a						       =				None
               __a						       =				None
               __a						       =				None
               __a						       =				None

               self.builder.download_and_prepare(
                   download_config=__SCREAMING_SNAKE_CASE     ,		download_mode=__SCREAMING_SNAKE_CASE     ,		verification_mode=__SCREAMING_SNAKE_CASE     ,		base_path=__SCREAMING_SNAKE_CASE     ,		num_proc=self.num_proc     ,		)
               __a						       =				self.builder.as_dataset(
                   split=self.split     ,		verification_mode=__SCREAMING_SNAKE_CASE     ,		in_memory=self.keep_in_memory)
           return dataset





