





'''simple docstring'''

import functools
import operator

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


__lowerCAmelCase							:	Tuple			=logging.get_logger(__name__)

__lowerCAmelCase							:	Any			={
    "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    UpperCAmelCase	(       UpperCamelCase__				):
 __lowercase   		=				"""unispeech-sat"""
 def __init__(				self      :List[Any]						,       lowercase_      :Dict=32						,       lowercase_      :Union[str, Any]=7_68						,       lowercase_      :Any=12						,       lowercase_      :Dict=12						,       lowercase_      :List[str]=30_72						,       lowercase_      :Any="gelu"						,       lowercase_      :int=0.1						,       lowercase_      :Optional[Any]=0.1						,       lowercase_      :Optional[int]=0.1						,       lowercase_      :Optional[int]=0.0						,       lowercase_      :int=0.0						,       lowercase_      :Tuple=0.1						,       lowercase_      :List[str]=0.1						,       lowercase_      :Dict=0.0_2						,       lowercase_      :int=1E-5						,       lowercase_      :int="group"						,       lowercase_      :List[Any]="gelu"						,       lowercase_      :Dict=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)						,       lowercase_      :Optional[int]=(5, 2, 2, 2, 2, 2, 2)						,       lowercase_      :Any=(10, 3, 3, 3, 3, 2, 2)						,       lowercase_      :int=False						,       lowercase_      :str=1_28						,       lowercase_      :Tuple=16						,       lowercase_      :Union[str, Any]=False						,       lowercase_      :Tuple=True						,       lowercase_      :List[str]=0.0_5						,       lowercase_      :Any=10						,       lowercase_      :Union[str, Any]=2						,       lowercase_      :Dict=0.0						,       lowercase_      :Optional[Any]=10						,       lowercase_      :List[Any]=0						,       lowercase_      :Tuple=3_20						,       lowercase_      :int=2						,       lowercase_      :List[Any]=0.1						,       lowercase_      :int=1_00						,       lowercase_      :int=2_56						,       lowercase_      :Dict=2_56						,       lowercase_      :Optional[int]=0.1						,       lowercase_      :str="mean"						,       lowercase_      :Optional[int]=False						,       lowercase_      :int=False						,       lowercase_      :Optional[int]=2_56						,       lowercase_      :Union[str, Any]=(5_12, 5_12, 5_12, 5_12, 15_00)						,       lowercase_      :str=(5, 3, 3, 1, 1)						,       lowercase_      :int=(1, 2, 3, 1, 1)						,       lowercase_      :Tuple=5_12						,       lowercase_      :Dict=0						,       lowercase_      :Union[str, Any]=1						,       lowercase_      :Union[str, Any]=2						,       lowercase_      :int=5_04						,       **lowercase_      :List[Any]						,       )->							Optional[int]:
     super().__init__(**lowercase_						,       pad_token_id=lowercase_						,       bos_token_id=lowercase_						,       eos_token_id=lowercase_							)
     A__				=			hidden_size
     A__				=			feat_extract_norm
     A__				=			feat_extract_activation
     A__				=			list(lowercase_							)
     A__				=			list(lowercase_							)
     A__				=			list(lowercase_							)
     A__				=			conv_bias
     A__				=			num_conv_pos_embeddings
     A__				=			num_conv_pos_embedding_groups
     A__				=			len(self.conv_dim							)
     A__				=			num_hidden_layers
     A__				=			intermediate_size
     A__				=			hidden_act
     A__				=			num_attention_heads
     A__				=			hidden_dropout
     A__				=			attention_dropout
     A__				=			activation_dropout
     A__				=			feat_proj_dropout
     A__				=			final_dropout
     A__				=			layerdrop
     A__				=			layer_norm_eps
     A__				=			initializer_range
     A__				=			vocab_size
     A__				=			num_clusters
     A__				=			do_stable_layer_norm
     A__				=			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
     A__				=			apply_spec_augment
     A__				=			mask_time_prob
     A__				=			mask_time_length
     A__				=			mask_time_min_masks
     A__				=			mask_feature_prob
     A__				=			mask_feature_length
     A__				=			mask_feature_min_masks

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

     # ctc loss
     A__				=			ctc_loss_reduction
     A__				=			ctc_zero_infinity

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

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



 @property
 def      UpperCAmelCase_							(				self      :int							)->							List[Any]:
     return functools.reduce(operator.mul						,       self.conv_stride						,       1							)










'''simple docstring'''

def 						UpperCamelCase				(							_lowerCamelCase					:					int | float | str       ):
    try:
        A__				=			float(_lowerCamelCase       )
    except ValueError:
        raise ValueError("Please enter a valid number"       )
    A__				=			decimal - int(_lowerCamelCase       )
    if fractional_part == 0:
        return int(_lowerCamelCase       ), 1
    else:
        A__				=			len(str(_lowerCamelCase       ).split("."       )[1]       )
        A__				=			int(decimal * (10**number_of_frac_digits)       )
        A__				=			10**number_of_frac_digits
        A__,	A__				=			denominator, numerator
        while True:
            A__				=			dividend % divisor
            if remainder == 0:
                break
            A__,	A__				=			divisor, remainder
        A__,	A__				=			numerator / divisor, denominator / divisor
        return int(_lowerCamelCase       ), int(_lowerCamelCase       )


if __name__ == "__main__":
  print(f"""{decimal_to_fraction(2) = }""")
  print(f"""{decimal_to_fraction(89.0) = }""")
  print(f"""{decimal_to_fraction("67") = }""")
  print(f"""{decimal_to_fraction("45.0") = }""")
  print(f"""{decimal_to_fraction(1.5) = }""")
  print(f"""{decimal_to_fraction("6.25") = }""")
  print(f"""{decimal_to_fraction("78td") = }""")



