






"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCAmelCase         =							logging.get_logger(__name__)

_lowerCAmelCase         =							{
    "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      SCREAMING_SNAKE_CASE  (				_SCREAMING_SNAKE_CASE						):





	"""simple docstring"""




	_A       :				Dict    =				"""speech_to_text"""
	_A       :				Any    =				["""past_key_values"""]
	_A       :				str    =				{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}





	def __init__(self     ,     lowerCAmelCase_=10000     ,     lowerCAmelCase_=12     ,     lowerCAmelCase_=2048     ,     lowerCAmelCase_=4     ,     lowerCAmelCase_=6     ,     lowerCAmelCase_=2048     ,     lowerCAmelCase_=4     ,     lowerCAmelCase_=0.0     ,     lowerCAmelCase_=0.0     ,     lowerCAmelCase_=True     ,     lowerCAmelCase_=True     ,     lowerCAmelCase_="relu"     ,     lowerCAmelCase_=256     ,     lowerCAmelCase_=0.1     ,     lowerCAmelCase_=0.0     ,     lowerCAmelCase_=0.0     ,     lowerCAmelCase_=0.02     ,     lowerCAmelCase_=2     ,     lowerCAmelCase_=True     ,     lowerCAmelCase_=1     ,     lowerCAmelCase_=0     ,     lowerCAmelCase_=2     ,     lowerCAmelCase_=6000     ,     lowerCAmelCase_=1024     ,     lowerCAmelCase_=2     ,     lowerCAmelCase_=(5, 5)     ,     lowerCAmelCase_=1024     ,     lowerCAmelCase_=80     ,     lowerCAmelCase_=1     ,     **lowerCAmelCase_     ,     ):
		A_		:						Union[str, Any]	    =   vocab_size
		A_		:						List[str]	    =   d_model
		A_		:						int	    =   encoder_ffn_dim
		A_		:						Tuple	    =   encoder_layers
		A_		:						Tuple	    =   encoder_attention_heads
		A_		:						Dict	    =   decoder_ffn_dim
		A_		:						List[str]	    =   decoder_layers
		A_		:						Dict	    =   decoder_attention_heads
		A_		:						List[str]	    =   dropout
		A_		:						int	    =   attention_dropout
		A_		:						int	    =   activation_dropout
		A_		:						List[str]	    =   activation_function
		A_		:						List[str]	    =   init_std
		A_		:						List[str]	    =   encoder_layerdrop
		A_		:						Any	    =   decoder_layerdrop
		A_		:						str	    =   use_cache
		A_		:						Dict	    =   encoder_layers
		A_		:						Tuple	    =   scale_embedding  # scale factor will be sqrt(d_model) if True
		A_		:						List[Any]	    =   max_source_positions
		A_		:						Optional[int]	    =   max_target_positions
		A_		:						List[Any]	    =   num_conv_layers
		A_		:						Union[str, Any]	    =   list(lowerCAmelCase_							)
		A_		:						Tuple	    =   conv_channels
		A_		:						Dict	    =   input_feat_per_channel
		A_		:						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"""
def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__					):
	return not any(
	    neighbour == 1 and colored_vertices[i] == color
	    for i, neighbour in enumerate(snake_case__					)					)






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__   ,   snake_case__					):

	# Base Case
	if index == len(snake_case__					):
		return True

	# Recursive Step
	for i in range(snake_case__					):
		if valid_coloring(graph[index]   ,   snake_case__   ,   snake_case__					):
			# Color current vertex
			A_		:						Dict	    =   i
			# Validate coloring
			if util_color(snake_case__   ,   snake_case__   ,   snake_case__   ,   index + 1					):
				return True
			# Backtrack
			A_		:						Union[str, Any]	    =   -1
	return False






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	A_		:						int	    =   [-1] * len(snake_case__					)

	if util_color(snake_case__   ,   snake_case__   ,   snake_case__   ,   0					):
		return colored_vertices

	return []

