


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


SCREAMING_SNAKE_CASE       :		Optional[Any]         =				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE       :		Tuple         =				{
    "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      UpperCamelCase					(		lowercase__     ):


   '''simple docstring'''







   lowercase					:	str									="""speech_to_text"""
   lowercase					:	Dict									=["""past_key_values"""]
   lowercase					:	Dict									={"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}
   def __init__(     self   ,							UpperCamelCase_=1_0000   ,							UpperCamelCase_=12   ,							UpperCamelCase_=2048   ,							UpperCamelCase_=4   ,							UpperCamelCase_=6   ,							UpperCamelCase_=2048   ,							UpperCamelCase_=4   ,							UpperCamelCase_=0.0   ,							UpperCamelCase_=0.0   ,							UpperCamelCase_=True   ,							UpperCamelCase_=True   ,							UpperCamelCase_="relu"   ,							UpperCamelCase_=256   ,							UpperCamelCase_=0.1   ,							UpperCamelCase_=0.0   ,							UpperCamelCase_=0.0   ,							UpperCamelCase_=0.02   ,							UpperCamelCase_=2   ,							UpperCamelCase_=True   ,							UpperCamelCase_=1   ,							UpperCamelCase_=0   ,							UpperCamelCase_=2   ,							UpperCamelCase_=6000   ,							UpperCamelCase_=1024   ,							UpperCamelCase_=2   ,							UpperCamelCase_=(5, 5)   ,							UpperCamelCase_=1024   ,							UpperCamelCase_=80   ,							UpperCamelCase_=1   ,							**UpperCamelCase_   ,							):
        lowercase_       :Union[str, Any]     =       vocab_size
        lowercase_       :Dict     =       d_model
        lowercase_       :str     =       encoder_ffn_dim
        lowercase_       :List[Any]     =       encoder_layers
        lowercase_       :str     =       encoder_attention_heads
        lowercase_       :List[str]     =       decoder_ffn_dim
        lowercase_       :Optional[Any]     =       decoder_layers
        lowercase_       :Optional[Any]     =       decoder_attention_heads
        lowercase_       :Optional[int]     =       dropout
        lowercase_       :str     =       attention_dropout
        lowercase_       :Dict     =       activation_dropout
        lowercase_       :Tuple     =       activation_function
        lowercase_       :Optional[Any]     =       init_std
        lowercase_       :str     =       encoder_layerdrop
        lowercase_       :str     =       decoder_layerdrop
        lowercase_       :str     =       use_cache
        lowercase_       :List[str]     =       encoder_layers
        lowercase_       :List[Any]     =       scale_embedding  # scale factor will be sqrt(d_model) if True
        lowercase_       :Union[str, Any]     =       max_source_positions
        lowercase_       :Optional[int]     =       max_target_positions
        lowercase_       :Any     =       num_conv_layers
        lowercase_       :Union[str, Any]     =       list(UpperCamelCase_		)
        lowercase_       :Union[str, Any]     =       conv_channels
        lowercase_       :int     =       input_feat_per_channel
        lowercase_       :str     =       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=UpperCamelCase_   ,							bos_token_id=UpperCamelCase_   ,							eos_token_id=UpperCamelCase_   ,							is_encoder_decoder=UpperCamelCase_   ,							decoder_start_token_id=UpperCamelCase_   ,							**UpperCamelCase_   ,							)





from __future__ import annotations




def     UpperCamelCase    (      _a       ,		_a = None       ,		_a = None		)					->							None:
     '''simple docstring'''





     if start is None:
          lowercase_       :str     =       0

     if end is None:
          lowercase_       :str     =       len(_a		) - 1

     if start >= end:
          return

     lowercase_       :Dict     =       (start + end) // 2

     slowsort(_a       ,		_a       ,		_a		)
     slowsort(_a       ,		mid + 1       ,		_a		)

     if sequence[end] < sequence[mid]:
          lowercase_    ,      lowercase_       :List[Any]     =       sequence[mid], sequence[end]

     slowsort(_a       ,		_a       ,		end - 1		)


if __name__ == "__main__":
   from doctest import testmod

   testmod()

