






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_	(		__snake_case			):
				_UpperCamelCase					:       Union[str, Any]							       = "speech_to_text"
				_UpperCamelCase					:       Optional[int]							       = ["past_key_values"]
				_UpperCamelCase					:       List[Any]							       = {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}


				def __init__(					self ,						_lowerCAmelCase=1_0_0_0_0 ,						_lowerCAmelCase=1_2 ,						_lowerCAmelCase=2_0_4_8 ,						_lowerCAmelCase=4 ,						_lowerCAmelCase=6 ,						_lowerCAmelCase=2_0_4_8 ,						_lowerCAmelCase=4 ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=True ,						_lowerCAmelCase=True ,						_lowerCAmelCase="relu" ,						_lowerCAmelCase=2_5_6 ,						_lowerCAmelCase=0.1 ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=0.02 ,						_lowerCAmelCase=2 ,						_lowerCAmelCase=True ,						_lowerCAmelCase=1 ,						_lowerCAmelCase=0 ,						_lowerCAmelCase=2 ,						_lowerCAmelCase=6_0_0_0 ,						_lowerCAmelCase=1_0_2_4 ,						_lowerCAmelCase=2 ,						_lowerCAmelCase=(5, 5) ,						_lowerCAmelCase=1_0_2_4 ,						_lowerCAmelCase=8_0 ,						_lowerCAmelCase=1 ,						**_lowerCAmelCase ,						):
											_lowercase							:   Tuple 							=   vocab_size
											_lowercase							:   int 							=   d_model
											_lowercase							:   Tuple 							=   encoder_ffn_dim
											_lowercase							:   Union[str, Any] 							=   encoder_layers
											_lowercase							:   Dict 							=   encoder_attention_heads
											_lowercase							:   int 							=   decoder_ffn_dim
											_lowercase							:   Any 							=   decoder_layers
											_lowercase							:   Optional[int] 							=   decoder_attention_heads
											_lowercase							:   Optional[int] 							=   dropout
											_lowercase							:   Optional[int] 							=   attention_dropout
											_lowercase							:   str 							=   activation_dropout
											_lowercase							:   int 							=   activation_function
											_lowercase							:   Dict 							=   init_std
											_lowercase							:   Any 							=   encoder_layerdrop
											_lowercase							:   Optional[int] 							=   decoder_layerdrop
											_lowercase							:   Tuple 							=   use_cache
											_lowercase							:   int 							=   encoder_layers
											_lowercase							:   List[Any] 							=   scale_embedding  # scale factor will be sqrt(d_model) if True
											_lowercase							:   Any 							=   max_source_positions
											_lowercase							:   Any 							=   max_target_positions
											_lowercase							:   Any 							=   num_conv_layers
											_lowercase							:   Union[str, Any] 							=   list(_lowerCAmelCase      )
											_lowercase							:   List[Any] 							=   conv_channels
											_lowercase							:   int 							=   input_feat_per_channel
											_lowercase							:   Union[str, 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=_lowerCAmelCase ,						bos_token_id=_lowerCAmelCase ,						eos_token_id=_lowerCAmelCase ,						is_encoder_decoder=_lowerCAmelCase ,						decoder_start_token_id=_lowerCAmelCase ,						**_lowerCAmelCase ,						)











'''simple docstring'''




import enum
import shutil
import sys


a__      ,       a__					:			Any          =     shutil.get_terminal_size()

a__					:			Optional[int]          =     {'''UP''': '''A''', '''DOWN''': '''B''', '''RIGHT''': '''C''', '''LEFT''': '''D'''}






class 				__snake_case     (					enum.Enum							):
	__lowerCAmelCase       						=  0
	__lowerCAmelCase       						=  1





def 						__lowerCamelCase			(	UpperCAmelCase_					,				UpperCAmelCase_=""							)   ->Optional[Any]:
	sys.stdout.write(str(UpperCAmelCase_							) + end							)
	sys.stdout.flush()




def 						__lowerCamelCase			(	UpperCAmelCase_					,				UpperCAmelCase_					,				UpperCAmelCase_=""							)   ->List[str]:
	forceWrite(f'''\u001b[{color}m{content}\u001b[0m'''					,				UpperCAmelCase_							)




def 						__lowerCamelCase			(	)   ->Optional[Any]:
	forceWrite('\r'							)




def 						__lowerCamelCase			(	UpperCAmelCase_					,				UpperCAmelCase_							)   ->Any:
	forceWrite(f'''\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'''							)




def 						__lowerCamelCase			(	)   ->str:
	forceWrite(' ' * TERMINAL_WIDTH							)
	reset_cursor()







def 						__lowerCamelCase			(	)   ->Tuple:
	reset_cursor()
	forceWrite('-' * TERMINAL_WIDTH							)



