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


__lowerCAmelCase    :	Any						=						logging.get_logger(__name__)

__lowerCAmelCase    :	Tuple						=						{
    """facebook/s2t-wav2vec2-large-en-de""": (
        """https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json"""
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}


class   __lowerCAmelCase		(		UpperCamelCase__					):



      """simple docstring"""







      A__		:	int         =			"""speech_to_text_2"""
      A__		:	Tuple         =			["""past_key_values"""]
      A__		:	Union[str, Any]         =			{"""num_attention_heads""": """decoder_attention_heads""", """hidden_size""": """d_model"""}




      def __init__(					self						:				List[str] ,				_snake_case						:				int=1_0000 ,				_snake_case						:				str=6 ,				_snake_case						:				List[Any]=2048 ,				_snake_case						:				Optional[int]=4 ,				_snake_case						:				Tuple=0.0 ,				_snake_case						:				Union[str, Any]=True ,				_snake_case						:				List[Any]="relu" ,				_snake_case						:				Any=256 ,				_snake_case						:				List[Any]=0.1 ,				_snake_case						:				str=0.0 ,				_snake_case						:				Optional[Any]=0.0 ,				_snake_case						:				Optional[Any]=0.02 ,				_snake_case						:				List[str]=2 ,				_snake_case						:				List[str]=True ,				_snake_case						:				Any=1 ,				_snake_case						:				str=0 ,				_snake_case						:				int=2 ,				_snake_case						:				List[Any]=1024 ,				**_snake_case						:				Union[str, Any] ,				):
          __lowercase						:	List[str]					=				vocab_size
          __lowercase						:	List[str]					=				d_model
          __lowercase						:	List[str]					=				decoder_ffn_dim
          __lowercase						:	Union[str, Any]					=				decoder_layers
          __lowercase						:	Dict					=				decoder_attention_heads
          __lowercase						:	Union[str, Any]					=				dropout
          __lowercase						:	str					=				attention_dropout
          __lowercase						:	Tuple					=				activation_dropout
          __lowercase						:	List[str]					=				activation_function
          __lowercase						:	Dict					=				init_std
          __lowercase						:	str					=				decoder_layerdrop
          __lowercase						:	Dict					=				use_cache
          __lowercase						:	List[str]					=				decoder_layers
          __lowercase						:	List[Any]					=				scale_embedding  # scale factor will be sqrt(d_model) if True
          __lowercase						:	Dict					=				max_target_positions

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









def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  if len(SCREAMING_SNAKE_CASE						) == 1:
    return True
  a__	:					Union[str, Any]										=series[1] - series[0]
  for index in range(len(SCREAMING_SNAKE_CASE						) - 1						):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True
def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  a__	:					Any										=0
  for val in series:
    answer += val
  return answer / len(SCREAMING_SNAKE_CASE						)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






