

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


__A			:					Tuple						=			logging.get_logger(__name__)

__A			:					str						=			{
    '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 (   _lowerCamelCase		):







   '''simple docstring'''




   lowerCamelCase__				=      'markuplm'





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




from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream



class        lowerCAmelCase__					(  _lowerCamelCase       ):


				def __init__(							self      :  int						, __UpperCamelCase      :  Callable						, __UpperCamelCase      :  Optional[Features] = None						, __UpperCamelCase      :  str = None						, __UpperCamelCase      :  bool = False						, __UpperCamelCase      :  bool = False						, __UpperCamelCase      :  Optional[dict] = None						, __UpperCamelCase      :  Optional[int] = None						, **__UpperCamelCase      :  str						, )		->     List[str]:
											super().__init__(
											    features=__UpperCamelCase						, cache_dir=__UpperCamelCase						, keep_in_memory=__UpperCamelCase						, streaming=__UpperCamelCase						, num_proc=__UpperCamelCase						, **__UpperCamelCase						, )
											A      						=    Generator(
											    cache_dir=__UpperCamelCase						, features=__UpperCamelCase						, generator=__UpperCamelCase						, gen_kwargs=__UpperCamelCase						, **__UpperCamelCase						, )


				def __UpperCamelCase						(							self      :  Union[str, Any]       )		->     Tuple:
											# Build iterable dataset
											if self.streaming:
																		A      						=    self.builder.as_streaming_dataset(split='train'       )
											# Build regular (map-style) dataset
											else:
																		A      						=    None
																		A      						=    None
																		A      						=    None
																		A      						=    None

																		self.builder.download_and_prepare(
																		    download_config=__UpperCamelCase						, download_mode=__UpperCamelCase						, verification_mode=__UpperCamelCase						, base_path=__UpperCamelCase						, num_proc=self.num_proc						, )
																		A      						=    self.builder.as_dataset(
																		    split='train'						, verification_mode=__UpperCamelCase						, in_memory=self.keep_in_memory       )
											return dataset