



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


__UpperCAmelCase	       =	logging.get_logger(__name__)

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









from abc import ABC, abstractmethod
from argparse import ArgumentParser



class     lowerCAmelCase_		(  a__							):
       @staticmethod
       @abstractmethod
       def  snake_case_	(      SCREAMING_SNAKE_CASE_	)					->		int:
          raise NotImplementedError()






       @abstractmethod
       def  snake_case_	(      self	)					->		str:
          raise NotImplementedError()



