


'''simple docstring'''

import functools
import operator

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


lowerCAmelCase				:Dict        =      logging.get_logger(__name__)

lowerCAmelCase				:str        =      {
    '''asapp/sew-d-tiny-100k''': '''https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json''',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}
class _lowerCamelCase	(						lowercase__							):



		'''simple docstring'''







		A_     :      Optional[int]				   =    """sew-d"""







		def __init__( self		:						Dict  ,					_A		:						str=32  ,					_A		:						Optional[int]=768  ,					_A		:						int=12  ,					_A		:						List[Any]=12  ,					_A		:						Optional[int]=3072  ,					_A		:						Tuple=2  ,					_A		:						Optional[int]=512  ,					_A		:						str=256  ,					_A		:						int=True  ,					_A		:						Optional[int]=True  ,					_A		:						Optional[Any]=("p2c", "c2p")  ,					_A		:						Optional[Any]="layer_norm"  ,					_A		:						Tuple="gelu_python"  ,					_A		:						Optional[Any]=0.1  ,					_A		:						List[str]=0.1  ,					_A		:						int=0.1  ,					_A		:						List[Any]=0.0  ,					_A		:						List[str]=0.1  ,					_A		:						Any=0.02  ,					_A		:						List[Any]=1E-7  ,					_A		:						Tuple=1E-5  ,					_A		:						Optional[Any]="group"  ,					_A		:						Optional[int]="gelu"  ,					_A		:						Union[str, Any]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)  ,					_A		:						Tuple=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)  ,					_A		:						Tuple=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)  ,					_A		:						Optional[Any]=False  ,					_A		:						Optional[Any]=128  ,					_A		:						Tuple=16  ,					_A		:						Dict=True  ,					_A		:						str=0.05  ,					_A		:						int=10  ,					_A		:						Optional[Any]=2  ,					_A		:						Union[str, Any]=0.0  ,					_A		:						str=10  ,					_A		:						int=0  ,					_A		:						Any="mean"  ,					_A		:						Any=False  ,					_A		:						Optional[int]=False  ,					_A		:						Any=256  ,					_A		:						Optional[int]=0  ,					_A		:						Any=1  ,					_A		:						Any=2  ,					**_A		:						List[Any]  ,					)  ->			List[Any]:
			super().__init__(**_A  ,					pad_token_id=_A  ,					bos_token_id=_A  ,					eos_token_id=_A      )
			__magic_name__	:   Dict					     =					hidden_size
			__magic_name__	:   int					     =					feat_extract_norm
			__magic_name__	:   List[str]					     =					feat_extract_activation
			__magic_name__	:   Tuple					     =					list(_A      )
			__magic_name__	:   int					     =					list(_A      )
			__magic_name__	:   str					     =					list(_A      )
			__magic_name__	:   Union[str, Any]					     =					conv_bias
			__magic_name__	:   Union[str, Any]					     =					num_conv_pos_embeddings
			__magic_name__	:   Any					     =					num_conv_pos_embedding_groups
			__magic_name__	:   str					     =					len(self.conv_dim      )
			__magic_name__	:   str					     =					num_hidden_layers
			__magic_name__	:   Dict					     =					intermediate_size
			__magic_name__	:   Optional[int]					     =					squeeze_factor
			__magic_name__	:   Dict					     =					max_position_embeddings
			__magic_name__	:   List[str]					     =					position_buckets
			__magic_name__	:   Optional[int]					     =					share_att_key
			__magic_name__	:   Optional[Any]					     =					relative_attention
			__magic_name__	:   int					     =					norm_rel_ebd
			__magic_name__	:   Dict					     =					list(_A      )
			__magic_name__	:   Tuple					     =					hidden_act
			__magic_name__	:   Dict					     =					num_attention_heads
			__magic_name__	:   Tuple					     =					hidden_dropout
			__magic_name__	:   Optional[Any]					     =					attention_dropout
			__magic_name__	:   List[Any]					     =					activation_dropout
			__magic_name__	:   Optional[int]					     =					feat_proj_dropout
			__magic_name__	:   Dict					     =					final_dropout
			__magic_name__	:   int					     =					layer_norm_eps
			__magic_name__	:   Any					     =					feature_layer_norm_eps
			__magic_name__	:   str					     =					initializer_range
			__magic_name__	:   Optional[int]					     =					vocab_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)`,'
				    F'but is `len(config.conv_dim) = {len(self.conv_dim      )}`, `len(config.conv_stride)'
				    F'= {len(self.conv_stride      )}`, `len(config.conv_kernel) = {len(self.conv_kernel      )}`.'      )

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

			# ctc loss
			__magic_name__	:   Any					     =					ctc_loss_reduction
			__magic_name__	:   Union[str, Any]					     =					ctc_zero_infinity

			# sequence classification
			__magic_name__	:   str					     =					use_weighted_layer_sum
			__magic_name__	:   Dict					     =					classifier_proj_size







		@property
		def        __lowerCAmelCase		( self		:						List[Any]      )  ->			str:
			return functools.reduce(operator.mul  ,					self.conv_stride  ,					1      )



'''simple docstring'''

lowerCAmelCase				:Union[str, Any]        =      '''
# Transformers installation
! pip install transformers datasets
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/transformers.git
'''

lowerCAmelCase				:Union[str, Any]        =      [{'''type''': '''code''', '''content''': INSTALL_CONTENT}]
lowerCAmelCase				:Tuple        =      {
    '''{processor_class}''': '''FakeProcessorClass''',
    '''{model_class}''': '''FakeModelClass''',
    '''{object_class}''': '''FakeObjectClass''',
}