"""simple docstring"""


import functools
import operator

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


lowerCAmelCase_:					Optional[int]     =					logging.get_logger(__name__)

lowerCAmelCase_:					List[str]     =					{
    "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json",
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}






class    a__    (   _a	):
   snake_case_							=      "wavlm"


   def __init__(     self,				_UpperCAmelCase=32,				_UpperCAmelCase=768,				_UpperCAmelCase=12,				_UpperCAmelCase=12,				_UpperCAmelCase=3072,				_UpperCAmelCase="gelu",				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.02,				_UpperCAmelCase=1E-5,				_UpperCAmelCase="group",				_UpperCAmelCase="gelu",				_UpperCAmelCase=(512, 512, 512, 512, 512, 512, 512),				_UpperCAmelCase=(5, 2, 2, 2, 2, 2, 2),				_UpperCAmelCase=(10, 3, 3, 3, 3, 2, 2),				_UpperCAmelCase=False,				_UpperCAmelCase=128,				_UpperCAmelCase=16,				_UpperCAmelCase=320,				_UpperCAmelCase=800,				_UpperCAmelCase=False,				_UpperCAmelCase=True,				_UpperCAmelCase=0.05,				_UpperCAmelCase=10,				_UpperCAmelCase=2,				_UpperCAmelCase=0.0,				_UpperCAmelCase=10,				_UpperCAmelCase=320,				_UpperCAmelCase=2,				_UpperCAmelCase=0.1,				_UpperCAmelCase=100,				_UpperCAmelCase=256,				_UpperCAmelCase=256,				_UpperCAmelCase=0.1,				_UpperCAmelCase="mean",				_UpperCAmelCase=False,				_UpperCAmelCase=False,				_UpperCAmelCase=256,				_UpperCAmelCase=(512, 512, 512, 512, 1500),				_UpperCAmelCase=(5, 3, 3, 1, 1),				_UpperCAmelCase=(1, 2, 3, 1, 1),				_UpperCAmelCase=512,				_UpperCAmelCase=80,				_UpperCAmelCase=0,				_UpperCAmelCase=1,				_UpperCAmelCase=2,				_UpperCAmelCase=False,				_UpperCAmelCase=3,				_UpperCAmelCase=2,				_UpperCAmelCase=3,				_UpperCAmelCase=None,				**_UpperCAmelCase,				):
        '''simple docstring'''



        super().__init__(**_UpperCAmelCase,				pad_token_id=_UpperCAmelCase,				bos_token_id=_UpperCAmelCase,				eos_token_id=_UpperCAmelCase  )
        lowercase__				 =							hidden_size
        lowercase__				 =							feat_extract_norm
        lowercase__				 =							feat_extract_activation
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							conv_bias
        lowercase__				 =							num_buckets
        lowercase__				 =							max_bucket_distance
        lowercase__				 =							num_conv_pos_embeddings
        lowercase__				 =							num_conv_pos_embedding_groups
        lowercase__				 =							len(self.conv_dim  )
        lowercase__				 =							num_hidden_layers
        lowercase__				 =							intermediate_size
        lowercase__				 =							hidden_act
        lowercase__				 =							num_attention_heads
        lowercase__				 =							hidden_dropout
        lowercase__				 =							attention_dropout
        lowercase__				 =							activation_dropout
        lowercase__				 =							feat_proj_dropout
        lowercase__				 =							final_dropout
        lowercase__				 =							layerdrop
        lowercase__				 =							layer_norm_eps
        lowercase__				 =							initializer_range
        lowercase__				 =							num_ctc_classes
        lowercase__				 =							vocab_size
        lowercase__				 =							do_stable_layer_norm
        lowercase__				 =							use_weighted_layer_sum
        lowercase__				 =							classifier_proj_size

        if (
            (len(self.conv_stride  ) != self.num_feat_extract_layers)
            or (len(self.conv_kernel  ) != self.num_feat_extract_layers)
            or (len(self.conv_dim  ) != self.num_feat_extract_layers)
        ):
             raise ValueError(
                 "Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="
                 " `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="
                 F''' {len(self.conv_dim  )}`, `len(config.conv_stride) = {len(self.conv_stride  )}`,'''
                 F''' `len(config.conv_kernel) = {len(self.conv_kernel  )}`.'''  )

        # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
        lowercase__				 =							apply_spec_augment
        lowercase__				 =							mask_time_prob
        lowercase__				 =							mask_time_length
        lowercase__				 =							mask_time_min_masks
        lowercase__				 =							mask_feature_prob
        lowercase__				 =							mask_feature_length

        # parameters for pretraining with codevector quantized representations
        lowercase__				 =							num_codevectors_per_group
        lowercase__				 =							num_codevector_groups
        lowercase__				 =							contrastive_logits_temperature
        lowercase__				 =							num_negatives
        lowercase__				 =							codevector_dim
        lowercase__				 =							proj_codevector_dim
        lowercase__				 =							diversity_loss_weight

        # ctc loss
        lowercase__				 =							ctc_loss_reduction
        lowercase__				 =							ctc_zero_infinity

        # adapter
        lowercase__				 =							add_adapter
        lowercase__				 =							adapter_kernel_size
        lowercase__				 =							adapter_stride
        lowercase__				 =							num_adapter_layers
        lowercase__				 =							output_hidden_size or hidden_size

        # SequenceClassification-specific parameter. Feel free to ignore for other classes.
        lowercase__				 =							classifier_proj_size

        # XVector-specific parameters. Feel free to ignore for other classes.
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							list(_UpperCAmelCase  )
        lowercase__				 =							xvector_output_dim


   @property
   def 	snake_case__	(     self  ):
        '''simple docstring'''



        return functools.reduce(operator.mul,				self.conv_stride,				1  )





"""simple docstring"""


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


lowerCAmelCase_:					List[Any]     =					logging.get_logger(__name__)

lowerCAmelCase_:					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    a__    (   _a	):
   snake_case_							=      "markuplm"


   def __init__(     self,				_UpperCAmelCase=3_0522,				_UpperCAmelCase=768,				_UpperCAmelCase=12,				_UpperCAmelCase=12,				_UpperCAmelCase=3072,				_UpperCAmelCase="gelu",				_UpperCAmelCase=0.1,				_UpperCAmelCase=0.1,				_UpperCAmelCase=512,				_UpperCAmelCase=2,				_UpperCAmelCase=0.02,				_UpperCAmelCase=1E-12,				_UpperCAmelCase=0,				_UpperCAmelCase=0,				_UpperCAmelCase=2,				_UpperCAmelCase=256,				_UpperCAmelCase=1024,				_UpperCAmelCase=216,				_UpperCAmelCase=1001,				_UpperCAmelCase=32,				_UpperCAmelCase=50,				_UpperCAmelCase="absolute",				_UpperCAmelCase=True,				_UpperCAmelCase=None,				**_UpperCAmelCase,				):
        '''simple docstring'''



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




