






'''simple docstring'''





import functools
import operator

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


snake_case    				=		logging.get_logger(__name__)

snake_case    				=		{
    """microsoft/unispeech-sat-base-100h-libri-ft""": (
        """https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json"""
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}


class  SCREAMING_SNAKE_CASE			(			lowerCAmelCase					):
     '''simple docstring'''


     UpperCamelCase_							:		List[Any]			=	'''unispeech-sat'''


     def __init__(				self       :	Optional[int]					, UpperCAmelCase_       :	Tuple=32					, UpperCAmelCase_       :	str=768					, UpperCAmelCase_       :	Optional[int]=12					, UpperCAmelCase_       :	List[Any]=12					, UpperCAmelCase_       :	Optional[int]=3072					, UpperCAmelCase_       :	Tuple="gelu"					, UpperCAmelCase_       :	Tuple=0.1					, UpperCAmelCase_       :	Any=0.1					, UpperCAmelCase_       :	List[str]=0.1					, UpperCAmelCase_       :	Tuple=0.0					, UpperCAmelCase_       :	int=0.0					, UpperCAmelCase_       :	Dict=0.1					, UpperCAmelCase_       :	str=0.1					, UpperCAmelCase_       :	List[str]=0.02					, UpperCAmelCase_       :	List[str]=1E-5					, UpperCAmelCase_       :	Dict="group"					, UpperCAmelCase_       :	Tuple="gelu"					, UpperCAmelCase_       :	Tuple=(512, 512, 512, 512, 512, 512, 512)					, UpperCAmelCase_       :	int=(5, 2, 2, 2, 2, 2, 2)					, UpperCAmelCase_       :	Dict=(10, 3, 3, 3, 3, 2, 2)					, UpperCAmelCase_       :	Any=False					, UpperCAmelCase_       :	Union[str, Any]=128					, UpperCAmelCase_       :	Union[str, Any]=16					, UpperCAmelCase_       :	Dict=False					, UpperCAmelCase_       :	List[str]=True					, UpperCAmelCase_       :	List[Any]=0.05					, UpperCAmelCase_       :	Optional[Any]=10					, UpperCAmelCase_       :	List[str]=2					, UpperCAmelCase_       :	Any=0.0					, UpperCAmelCase_       :	List[str]=10					, UpperCAmelCase_       :	Union[str, Any]=0					, UpperCAmelCase_       :	int=320					, UpperCAmelCase_       :	Tuple=2					, UpperCAmelCase_       :	str=0.1					, UpperCAmelCase_       :	Any=100					, UpperCAmelCase_       :	str=256					, UpperCAmelCase_       :	Optional[int]=256					, UpperCAmelCase_       :	List[str]=0.1					, UpperCAmelCase_       :	Any="mean"					, UpperCAmelCase_       :	List[Any]=False					, UpperCAmelCase_       :	Dict=False					, UpperCAmelCase_       :	List[Any]=256					, UpperCAmelCase_       :	str=(512, 512, 512, 512, 1500)					, UpperCAmelCase_       :	Optional[int]=(5, 3, 3, 1, 1)					, UpperCAmelCase_       :	str=(1, 2, 3, 1, 1)					, UpperCAmelCase_       :	Any=512					, UpperCAmelCase_       :	Tuple=0					, UpperCAmelCase_       :	Dict=1					, UpperCAmelCase_       :	Tuple=2					, UpperCAmelCase_       :	Union[str, Any]=504					, **UpperCAmelCase_       :	str					, ):
       super().__init__(**UpperCAmelCase_					, pad_token_id=UpperCAmelCase_					, bos_token_id=UpperCAmelCase_					, eos_token_id=UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Any							=    hidden_size
       SCREAMING_SNAKE_CASE       :      int							=    feat_extract_norm
       SCREAMING_SNAKE_CASE       :      int							=    feat_extract_activation
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      List[str]							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Any							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      List[Any]							=    conv_bias
       SCREAMING_SNAKE_CASE       :      Tuple							=    num_conv_pos_embeddings
       SCREAMING_SNAKE_CASE       :      List[str]							=    num_conv_pos_embedding_groups
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    len(self.conv_dim      )
       SCREAMING_SNAKE_CASE       :      List[str]							=    num_hidden_layers
       SCREAMING_SNAKE_CASE       :      Tuple							=    intermediate_size
       SCREAMING_SNAKE_CASE       :      List[str]							=    hidden_act
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    num_attention_heads
       SCREAMING_SNAKE_CASE       :      int							=    hidden_dropout
       SCREAMING_SNAKE_CASE       :      int							=    attention_dropout
       SCREAMING_SNAKE_CASE       :      Any							=    activation_dropout
       SCREAMING_SNAKE_CASE       :      Union[str, Any]							=    feat_proj_dropout
       SCREAMING_SNAKE_CASE       :      Dict							=    final_dropout
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    layerdrop
       SCREAMING_SNAKE_CASE       :      List[str]							=    layer_norm_eps
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    initializer_range
       SCREAMING_SNAKE_CASE       :      Any							=    vocab_size
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    num_clusters
       SCREAMING_SNAKE_CASE       :      str							=    do_stable_layer_norm
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    use_weighted_layer_sum

       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
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    apply_spec_augment
       SCREAMING_SNAKE_CASE       :      Dict							=    mask_time_prob
       SCREAMING_SNAKE_CASE       :      Any							=    mask_time_length
       SCREAMING_SNAKE_CASE       :      Dict							=    mask_time_min_masks
       SCREAMING_SNAKE_CASE       :      Any							=    mask_feature_prob
       SCREAMING_SNAKE_CASE       :      Dict							=    mask_feature_length
       SCREAMING_SNAKE_CASE       :      List[Any]							=    mask_feature_min_masks

       # parameters for pretraining with codevector quantized representations
       SCREAMING_SNAKE_CASE       :      Union[str, Any]							=    num_codevectors_per_group
       SCREAMING_SNAKE_CASE       :      Optional[Any]							=    num_codevector_groups
       SCREAMING_SNAKE_CASE       :      Any							=    contrastive_logits_temperature
       SCREAMING_SNAKE_CASE       :      List[Any]							=    feat_quantizer_dropout
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    num_negatives
       SCREAMING_SNAKE_CASE       :      Union[str, Any]							=    codevector_dim
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    proj_codevector_dim
       SCREAMING_SNAKE_CASE       :      Dict							=    diversity_loss_weight

       # ctc loss
       SCREAMING_SNAKE_CASE       :      Any							=    ctc_loss_reduction
       SCREAMING_SNAKE_CASE       :      List[str]							=    ctc_zero_infinity

       # SequenceClassification-specific parameter. Feel free to ignore for other classes.
       SCREAMING_SNAKE_CASE       :      List[Any]							=    classifier_proj_size

       # XVector-specific parameters. Feel free to ignore for other classes.
       SCREAMING_SNAKE_CASE       :      List[str]							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Tuple							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Any							=    list(UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Dict							=    xvector_output_dim






     @property
     def 				_A       (				self       :	List[str]      ):
       return functools.reduce(operator.mul					, self.conv_stride					, 1      )














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


snake_case    				=		logging.get_logger(__name__)

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  SCREAMING_SNAKE_CASE			(			lowerCAmelCase					):
     '''simple docstring'''


     UpperCamelCase_							:		Optional[int]			=	'''markuplm'''


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






