




'''simple docstring'''







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


A     =logging.get_logger(__name__)

A     ={
    "facebook/s2t-small-librispeech-asr": (
        "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json"
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}


class 			_a  (	UpperCamelCase__ ):
       __a				:     List[str]   				=					"""speech_to_text"""
       __a				:     Tuple   				=					["""past_key_values"""]
       __a				:     int   				=					{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}
       def __init__(	self						:	List[str]   ,				lowercase						:	Tuple=10_000   ,				lowercase						:	Union[str, Any]=12   ,				lowercase						:	List[str]=2_048   ,				lowercase						:	List[Any]=4   ,				lowercase						:	Optional[Any]=6   ,				lowercase						:	Union[str, Any]=2_048   ,				lowercase						:	Tuple=4   ,				lowercase						:	List[str]=0.0   ,				lowercase						:	Union[str, Any]=0.0   ,				lowercase						:	Tuple=True   ,				lowercase						:	Any=True   ,				lowercase						:	List[Any]="relu"   ,				lowercase						:	Dict=256   ,				lowercase						:	int=0.1   ,				lowercase						:	int=0.0   ,				lowercase						:	List[str]=0.0   ,				lowercase						:	Union[str, Any]=0.02   ,				lowercase						:	Optional[Any]=2   ,				lowercase						:	Optional[Any]=True   ,				lowercase						:	Optional[Any]=1   ,				lowercase						:	str=0   ,				lowercase						:	Optional[Any]=2   ,				lowercase						:	Dict=6_000   ,				lowercase						:	int=1_024   ,				lowercase						:	List[Any]=2   ,				lowercase						:	Any=(5, 5)   ,				lowercase						:	Optional[Any]=1_024   ,				lowercase						:	Tuple=80   ,				lowercase						:	List[str]=1   ,				**lowercase						:	Union[str, Any]   ,				):



           '''simple docstring'''

           UpperCAmelCase			       =		vocab_size
           UpperCAmelCase			       =		d_model
           UpperCAmelCase			       =		encoder_ffn_dim
           UpperCAmelCase			       =		encoder_layers
           UpperCAmelCase			       =		encoder_attention_heads
           UpperCAmelCase			       =		decoder_ffn_dim
           UpperCAmelCase			       =		decoder_layers
           UpperCAmelCase			       =		decoder_attention_heads
           UpperCAmelCase			       =		dropout
           UpperCAmelCase			       =		attention_dropout
           UpperCAmelCase			       =		activation_dropout
           UpperCAmelCase			       =		activation_function
           UpperCAmelCase			       =		init_std
           UpperCAmelCase			       =		encoder_layerdrop
           UpperCAmelCase			       =		decoder_layerdrop
           UpperCAmelCase			       =		use_cache
           UpperCAmelCase			       =		encoder_layers
           UpperCAmelCase			       =		scale_embedding  # scale factor will be sqrt(d_model) if True
           UpperCAmelCase			       =		max_source_positions
           UpperCAmelCase			       =		max_target_positions
           UpperCAmelCase			       =		num_conv_layers
           UpperCAmelCase			       =		list(lowercase_				)
           UpperCAmelCase			       =		conv_channels
           UpperCAmelCase			       =		input_feat_per_channel
           UpperCAmelCase			       =		input_channels

           if len(self.conv_kernel_sizes				) != self.num_conv_layers:
               raise ValueError(
                   '''Configuration for convolutional module is incorrect. '''
                   '''It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '''
                   f"but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes				)}`, "
                   f"`config.num_conv_layers = {self.num_conv_layers}`."				)

           super().__init__(
               pad_token_id=lowercase_   ,				bos_token_id=lowercase_   ,				eos_token_id=lowercase_   ,				is_encoder_decoder=lowercase_   ,				decoder_start_token_id=lowercase_   ,				**lowercase_   ,				)











'''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") = }""")



