






'''simple docstring'''



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


SCREAMING_SNAKE_CASE							=						logging.get_logger(__name__)

SCREAMING_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 UpperCAmelCase_       (     __A					):




      """simple docstring"""




      UpperCamelCase_             =      '''markuplm'''






      def __init__(			self      :		Union[str, Any]  ,   UpperCAmelCase      :		Union[str, Any]=3_0522  ,   UpperCAmelCase      :		Union[str, Any]=768  ,   UpperCAmelCase      :		List[str]=12  ,   UpperCAmelCase      :		Tuple=12  ,   UpperCAmelCase      :		Optional[int]=3072  ,   UpperCAmelCase      :		Optional[Any]="gelu"  ,   UpperCAmelCase      :		str=0.1  ,   UpperCAmelCase      :		List[Any]=0.1  ,   UpperCAmelCase      :		str=512  ,   UpperCAmelCase      :		str=2  ,   UpperCAmelCase      :		Dict=0.0_2  ,   UpperCAmelCase      :		Optional[int]=1e-12  ,   UpperCAmelCase      :		Any=0  ,   UpperCAmelCase      :		Any=0  ,   UpperCAmelCase      :		str=2  ,   UpperCAmelCase      :		Optional[Any]=256  ,   UpperCAmelCase      :		Optional[int]=1024  ,   UpperCAmelCase      :		int=216  ,   UpperCAmelCase      :		List[str]=1001  ,   UpperCAmelCase      :		Any=32  ,   UpperCAmelCase      :		List[str]=50  ,   UpperCAmelCase      :		int="absolute"  ,   UpperCAmelCase      :		str=True  ,   UpperCAmelCase      :		Optional[int]=None  ,   **UpperCAmelCase      :		Optional[Any]  ,   )	->	Dict:


       '''simple docstring'''

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











'''simple docstring'''



from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


SCREAMING_SNAKE_CASE							=						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE							=						{
    'google/bit-50': 'https://huggingface.co/google/bit-50/resolve/main/config.json',
}
class UpperCAmelCase_       (     __A					,							__A					):




      """simple docstring"""




      UpperCamelCase_             =      '''bit'''
      UpperCamelCase_             =      ['''preactivation''', '''bottleneck''']
      UpperCamelCase_             =      ['''SAME''', '''VALID''']






      def __init__(			self      :		Any  ,   UpperCAmelCase      :		Optional[int]=3  ,   UpperCAmelCase      :		Any=64  ,   UpperCAmelCase      :		List[str]=[256, 512, 1024, 2048]  ,   UpperCAmelCase      :		Dict=[3, 4, 6, 3]  ,   UpperCAmelCase      :		List[Any]="preactivation"  ,   UpperCAmelCase      :		Tuple="relu"  ,   UpperCAmelCase      :		Tuple=None  ,   UpperCAmelCase      :		Tuple=32  ,   UpperCAmelCase      :		Optional[int]=0.0  ,   UpperCAmelCase      :		Union[str, Any]=False  ,   UpperCAmelCase      :		Dict=32  ,   UpperCAmelCase      :		Any=1  ,   UpperCAmelCase      :		str=None  ,   UpperCAmelCase      :		Union[str, Any]=None  ,   **UpperCAmelCase      :		str  ,   )	->	Dict:


       '''simple docstring'''

       super().__init__(**UpperCAmelCase		)
       if layer_type not in self.layer_types:
        raise ValueError(f'layer_type={layer_type} is not one of {",".join(self.layer_types		)}'		)
       if global_padding is not None:
        if global_padding.upper() in self.supported_padding:
         lowercase       : Any						=global_padding.upper()
        else:
         raise ValueError(f'Padding strategy {global_padding} not supported'		)
       lowercase       : List[Any]						=num_channels
       lowercase       : List[str]						=embedding_size
       lowercase       : Union[str, Any]						=hidden_sizes
       lowercase       : Union[str, Any]						=depths
       lowercase       : Optional[int]						=layer_type
       lowercase       : Optional[Any]						=hidden_act
       lowercase       : List[str]						=global_padding
       lowercase       : Dict						=num_groups
       lowercase       : Optional[Any]						=drop_path_rate
       lowercase       : Union[str, Any]						=embedding_dynamic_padding
       lowercase       : Any						=output_stride
       lowercase       : Union[str, Any]						=width_factor

       lowercase       : Union[str, Any]						=['''stem'''] + [f'stage{idx}' for idx in range(1  ,   len(UpperCAmelCase		) + 1		)]
       lowercase	,		lowercase       : List[str]						=get_aligned_output_features_output_indices(
           out_features=UpperCAmelCase  ,   out_indices=UpperCAmelCase  ,   stage_names=self.stage_names		)



