


"""simple docstring"""




import functools
import operator

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


lowercase_			     =  logging.get_logger(__name__)

lowercase_			     =  {
    "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json",
    # See all SEW models at https://huggingface.co/models?filter=sew
}
class 					__lowerCAmelCase					(   __SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		__UpperCAmelCase		:			int										=				'sew'

		def __init__(  self							, _a=32							, _a=768							, _a=12							, _a=12							, _a=3_072							, _a=2							, _a="gelu"							, _a=0.1							, _a=0.1							, _a=0.1							, _a=0.0							, _a=0.1							, _a=0.1							, _a=0.02							, _a=1E-5							, _a="group"							, _a="gelu"							, _a=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)							, _a=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)							, _a=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)							, _a=False							, _a=128							, _a=16							, _a=True							, _a=0.05							, _a=10							, _a=2							, _a=0.0							, _a=10							, _a=0							, _a="mean"							, _a=False							, _a=False							, _a=256							, _a=0							, _a=1							, _a=2							, **_a							, ):
				super().__init__(**_a							, pad_token_id=_a							, bos_token_id=_a							, eos_token_id=_a      )
				__a           =			hidden_size
				__a           =			feat_extract_norm
				__a           =			feat_extract_activation
				__a           =			list(_a      )
				__a           =			list(_a      )
				__a           =			list(_a      )
				__a           =			conv_bias
				__a           =			num_conv_pos_embeddings
				__a           =			num_conv_pos_embedding_groups
				__a           =			len(self.conv_dim      )
				__a           =			num_hidden_layers
				__a           =			intermediate_size
				__a           =			squeeze_factor
				__a           =			hidden_act
				__a           =			num_attention_heads
				__a           =			hidden_dropout
				__a           =			attention_dropout
				__a           =			activation_dropout
				__a           =			feat_proj_dropout
				__a           =			final_dropout
				__a           =			layerdrop
				__a           =			layer_norm_eps
				__a           =			initializer_range
				__a           =			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
				__a           =			apply_spec_augment
				__a           =			mask_time_prob
				__a           =			mask_time_length
				__a           =			mask_time_min_masks
				__a           =			mask_feature_prob
				__a           =			mask_feature_length
				__a           =			mask_feature_min_masks

				# ctc loss
				__a           =			ctc_loss_reduction
				__a           =			ctc_zero_infinity

				# sequence classification
				__a           =			use_weighted_layer_sum
				__a           =			classifier_proj_size





		@property
		def 			__UpperCAmelCase       (  self      ):
				return functools.reduce(operator.mul							, self.conv_stride							, 1      )










"""simple docstring"""




import warnings

from ..trainer import Trainer
from ..utils import logging


lowercase_			     =  logging.get_logger(__name__)
class 					__lowerCAmelCase					(   __SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		def __init__(  self							, _a=None							, **_a      ):
				warnings.warn(
				    '''`SageMakerTrainer` is deprecated and will be removed in v5 of Transformers. You can use `Trainer` '''
				    '''instead.'''							, _a							, )
				super().__init__(args=_a							, **_a      )






