



"""simple docstring"""






import functools
import operator

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


__snake_case							:     Union[str, Any]   =					logging.get_logger(__name__)

__snake_case							:     Dict   =					{
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}



class     A__     (						__UpperCAmelCase							):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE					   =			"""unispeech"""

	def __init__(  self:	str ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=32 ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=768 ,    _SCREAMING_SNAKE_CASE:	Optional[Any]=12 ,    _SCREAMING_SNAKE_CASE:	Dict=12 ,    _SCREAMING_SNAKE_CASE:	Any=3072 ,    _SCREAMING_SNAKE_CASE:	List[str]="gelu" ,    _SCREAMING_SNAKE_CASE:	Any=0.1 ,    _SCREAMING_SNAKE_CASE:	str=0.1 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=0.1 ,    _SCREAMING_SNAKE_CASE:	int=0.0 ,    _SCREAMING_SNAKE_CASE:	List[str]=0.0 ,    _SCREAMING_SNAKE_CASE:	List[Any]=0.1 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=0.1 ,    _SCREAMING_SNAKE_CASE:	Optional[Any]=0.02 ,    _SCREAMING_SNAKE_CASE:	Dict=1e-5 ,    _SCREAMING_SNAKE_CASE:	List[str]="group" ,    _SCREAMING_SNAKE_CASE:	Any="gelu" ,    _SCREAMING_SNAKE_CASE:	Tuple=(512, 512, 512, 512, 512, 512, 512) ,    _SCREAMING_SNAKE_CASE:	List[str]=(5, 2, 2, 2, 2, 2, 2) ,    _SCREAMING_SNAKE_CASE:	List[Any]=(10, 3, 3, 3, 3, 2, 2) ,    _SCREAMING_SNAKE_CASE:	Optional[int]=False ,    _SCREAMING_SNAKE_CASE:	List[str]=128 ,    _SCREAMING_SNAKE_CASE:	str=16 ,    _SCREAMING_SNAKE_CASE:	Tuple=False ,    _SCREAMING_SNAKE_CASE:	str=True ,    _SCREAMING_SNAKE_CASE:	int=0.05 ,    _SCREAMING_SNAKE_CASE:	Dict=10 ,    _SCREAMING_SNAKE_CASE:	List[Any]=2 ,    _SCREAMING_SNAKE_CASE:	Tuple=0.0 ,    _SCREAMING_SNAKE_CASE:	List[str]=10 ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=0 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=320 ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=2 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=0.1 ,    _SCREAMING_SNAKE_CASE:	List[Any]=100 ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=256 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=256 ,    _SCREAMING_SNAKE_CASE:	int=0.1 ,    _SCREAMING_SNAKE_CASE:	List[Any]="mean" ,    _SCREAMING_SNAKE_CASE:	List[str]=False ,    _SCREAMING_SNAKE_CASE:	List[str]=False ,    _SCREAMING_SNAKE_CASE:	Any=256 ,    _SCREAMING_SNAKE_CASE:	Tuple=80 ,    _SCREAMING_SNAKE_CASE:	int=0 ,    _SCREAMING_SNAKE_CASE:	List[str]=1 ,    _SCREAMING_SNAKE_CASE:	int=2 ,    _SCREAMING_SNAKE_CASE:	Tuple=0.5 ,    **_SCREAMING_SNAKE_CASE:	Union[str, Any] ,    )       -> List[str]:

				"""simple docstring"""

				super().__init__(**UpperCAmelCase_ ,    pad_token_id=UpperCAmelCase_ ,    bos_token_id=UpperCAmelCase_ ,    eos_token_id=UpperCAmelCase_)
				__lowerCAmelCase   :						Optional[int]				= hidden_size
				__lowerCAmelCase   :						Dict				= feat_extract_norm
				__lowerCAmelCase   :						Any				= feat_extract_activation
				__lowerCAmelCase   :						int				= list(UpperCAmelCase_)
				__lowerCAmelCase   :						Optional[int]				= list(UpperCAmelCase_)
				__lowerCAmelCase   :						Optional[int]				= list(UpperCAmelCase_)
				__lowerCAmelCase   :						List[Any]				= conv_bias
				__lowerCAmelCase   :						Any				= num_conv_pos_embeddings
				__lowerCAmelCase   :						Tuple				= num_conv_pos_embedding_groups
				__lowerCAmelCase   :						Dict				= len(self.conv_dim)
				__lowerCAmelCase   :						Any				= num_hidden_layers
				__lowerCAmelCase   :						Tuple				= intermediate_size
				__lowerCAmelCase   :						List[str]				= hidden_act
				__lowerCAmelCase   :						List[str]				= num_attention_heads
				__lowerCAmelCase   :						Dict				= hidden_dropout
				__lowerCAmelCase   :						int				= attention_dropout
				__lowerCAmelCase   :						Tuple				= activation_dropout
				__lowerCAmelCase   :						Dict				= feat_proj_dropout
				__lowerCAmelCase   :						str				= final_dropout
				__lowerCAmelCase   :						Tuple				= layerdrop
				__lowerCAmelCase   :						Optional[int]				= layer_norm_eps
				__lowerCAmelCase   :						List[Any]				= initializer_range
				__lowerCAmelCase   :						Optional[int]				= num_ctc_classes
				__lowerCAmelCase   :						List[str]				= vocab_size
				__lowerCAmelCase   :						int				= do_stable_layer_norm
				__lowerCAmelCase   :						Optional[int]				= use_weighted_layer_sum
				__lowerCAmelCase   :						List[Any]				= classifier_proj_size

				if (
				    (len(self.conv_stride) != self.num_feat_extract_layers)
				    or (len(self.conv_kernel) != self.num_feat_extract_layers)
				    or (len(self.conv_dim) != self.num_feat_extract_layers)
				):
							raise ValueError(
							    "Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="
							    " `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="
							    F""" {len(self.conv_dim)}`, `len(config.conv_stride) = {len(self.conv_stride)}`,"""
							    F""" `len(config.conv_kernel) = {len(self.conv_kernel)}`.""")

				# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
				__lowerCAmelCase   :						Union[str, Any]				= apply_spec_augment
				__lowerCAmelCase   :						Any				= mask_time_prob
				__lowerCAmelCase   :						Union[str, Any]				= mask_time_length
				__lowerCAmelCase   :						Union[str, Any]				= mask_time_min_masks
				__lowerCAmelCase   :						Any				= mask_feature_prob
				__lowerCAmelCase   :						Dict				= mask_feature_length
				__lowerCAmelCase   :						List[str]				= mask_feature_min_masks

				# parameters for pretraining with codevector quantized representations
				__lowerCAmelCase   :						Dict				= num_codevectors_per_group
				__lowerCAmelCase   :						Tuple				= num_codevector_groups
				__lowerCAmelCase   :						List[Any]				= contrastive_logits_temperature
				__lowerCAmelCase   :						Any				= feat_quantizer_dropout
				__lowerCAmelCase   :						List[Any]				= num_negatives
				__lowerCAmelCase   :						Any				= codevector_dim
				__lowerCAmelCase   :						str				= proj_codevector_dim
				__lowerCAmelCase   :						Any				= diversity_loss_weight

				# ctc loss
				__lowerCAmelCase   :						List[Any]				= ctc_loss_reduction
				__lowerCAmelCase   :						List[Any]				= ctc_zero_infinity

				# pretraining loss
				__lowerCAmelCase   :						Union[str, Any]				= replace_prob







	@property
	def 							_SCREAMING_SNAKE_CASE     (  self:	Optional[Any])       -> Tuple:

				"""simple docstring"""

				return functools.reduce(operator.mul ,    self.conv_stride ,    1)




"""simple docstring"""






def     _lowercase       (						__snake_case      ,__snake_case			)		->     list:
			__lowerCAmelCase   :						List[str]				= len(__snake_case			)
			__lowerCAmelCase   :						Dict				= []
			for i in range(len(__snake_case			) - pat_len + 1			):
						__lowerCAmelCase   :						List[Any]				= True
						for j in range(__snake_case			):
									if s[i + j] != pattern[j]:
												__lowerCAmelCase   :						Union[str, Any]				= False
												break
						if match_found:
									position.append(__snake_case			)
			return position


if __name__ == "__main__":
	assert naive_pattern_search('ABCDEFG', 'DE') == [3]
	print(naive_pattern_search('ABAAABCDBBABCDDEBCABC', 'ABC'))