






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


lowercase    				=   logging.get_logger(__name__)

lowercase    				=   {
    "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_ (     snake_case_							):



	'''simple docstring'''




	lowerCAmelCase						=					'''speech_to_text'''
	lowerCAmelCase						=					['''past_key_values''']
	lowerCAmelCase						=					{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}




	def __init__(			self			,     a=1_00_00			,     a=12			,     a=20_48			,     a=4			,     a=6			,     a=20_48			,     a=4			,     a=0.0			,     a=0.0			,     a=True			,     a=True			,     a="relu"			,     a=2_56			,     a=0.1			,     a=0.0			,     a=0.0			,     a=0.02			,     a=2			,     a=True			,     a=1			,     a=0			,     a=2			,     a=60_00			,     a=10_24			,     a=2			,     a=(5, 5)			,     a=10_24			,     a=80			,     a=1			,     **a			,     )			->       Any:
								snake_case_           =				vocab_size
								snake_case_           =				d_model
								snake_case_           =				encoder_ffn_dim
								snake_case_           =				encoder_layers
								snake_case_           =				encoder_attention_heads
								snake_case_           =				decoder_ffn_dim
								snake_case_           =				decoder_layers
								snake_case_           =				decoder_attention_heads
								snake_case_           =				dropout
								snake_case_           =				attention_dropout
								snake_case_           =				activation_dropout
								snake_case_           =				activation_function
								snake_case_           =				init_std
								snake_case_           =				encoder_layerdrop
								snake_case_           =				decoder_layerdrop
								snake_case_           =				use_cache
								snake_case_           =				encoder_layers
								snake_case_           =				scale_embedding  # scale factor will be sqrt(d_model) if True
								snake_case_           =				max_source_positions
								snake_case_           =				max_target_positions
								snake_case_           =				num_conv_layers
								snake_case_           =				list(a   )
								snake_case_           =				conv_channels
								snake_case_           =				input_feat_per_channel
								snake_case_           =				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=a			,     bos_token_id=a			,     eos_token_id=a			,     is_encoder_decoder=a			,     decoder_start_token_id=a			,     **a			,     )













class 					UpperCamelCase_ :



	'''simple docstring'''




	def __init__(			self			,     a   )			->       Tuple:
								snake_case_           =				n
								snake_case_           =				[None] * self.n
								snake_case_           =				0  # index of the first element
								snake_case_           =				0
								snake_case_           =				0




	def __len__(			self   )			->       int:
								return self.size




	def 				_UpperCamelCase     (			self   )			->       bool:
								return self.size == 0




	def 				_UpperCamelCase     (			self   )			->       List[Any]:
								return False if self.is_empty() else self.array[self.front]




	def 				_UpperCamelCase     (			self			,     a   )			->       Dict:
								if self.size >= self.n:
															raise Exception('QUEUE IS FULL'   )

								snake_case_           =				data
								snake_case_           =				(self.rear + 1) % self.n
								self.size += 1
								return self






	def 				_UpperCamelCase     (			self   )			->       List[Any]:
								if self.size == 0:
															raise Exception('UNDERFLOW'   )

								snake_case_           =				self.array[self.front]
								snake_case_           =				None
								snake_case_           =				(self.front + 1) % self.n
								self.size -= 1
								return temp





