





import functools
import operator

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


_a     :    List[str]         =						logging.get_logger(__name__)

_a     :    List[Any]         =						{
    '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_ (			lowercase_      ):
			A__      :			Tuple       	=  'unispeech'

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






							"""simple docstring"""
							super().__init__(**lowerCamelCase_     , pad_token_id=lowerCamelCase_     , bos_token_id=lowerCamelCase_     , eos_token_id=lowerCamelCase_						)
							snake_case   :					int    						=				hidden_size
							snake_case   :					Union[str, Any]    						=				feat_extract_norm
							snake_case   :					Dict    						=				feat_extract_activation
							snake_case   :					Optional[int]    						=				list(lowerCamelCase_						)
							snake_case   :					str    						=				list(lowerCamelCase_						)
							snake_case   :					Union[str, Any]    						=				list(lowerCamelCase_						)
							snake_case   :					Union[str, Any]    						=				conv_bias
							snake_case   :					List[str]    						=				num_conv_pos_embeddings
							snake_case   :					Union[str, Any]    						=				num_conv_pos_embedding_groups
							snake_case   :					Any    						=				len(self.conv_dim						)
							snake_case   :					Optional[Any]    						=				num_hidden_layers
							snake_case   :					Union[str, Any]    						=				intermediate_size
							snake_case   :					Optional[int]    						=				hidden_act
							snake_case   :					List[Any]    						=				num_attention_heads
							snake_case   :					Tuple    						=				hidden_dropout
							snake_case   :					Union[str, Any]    						=				attention_dropout
							snake_case   :					Union[str, Any]    						=				activation_dropout
							snake_case   :					Any    						=				feat_proj_dropout
							snake_case   :					Union[str, Any]    						=				final_dropout
							snake_case   :					Optional[int]    						=				layerdrop
							snake_case   :					Any    						=				layer_norm_eps
							snake_case   :					List[str]    						=				initializer_range
							snake_case   :					Any    						=				num_ctc_classes
							snake_case   :					List[Any]    						=				vocab_size
							snake_case   :					Tuple    						=				do_stable_layer_norm
							snake_case   :					Union[str, Any]    						=				use_weighted_layer_sum
							snake_case   :					Dict    						=				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
							snake_case   :					List[Any]    						=				apply_spec_augment
							snake_case   :					str    						=				mask_time_prob
							snake_case   :					Tuple    						=				mask_time_length
							snake_case   :					int    						=				mask_time_min_masks
							snake_case   :					Dict    						=				mask_feature_prob
							snake_case   :					Union[str, Any]    						=				mask_feature_length
							snake_case   :					List[str]    						=				mask_feature_min_masks

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

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

							# pretraining loss
							snake_case   :					str    						=				replace_prob



			@property
			def      lowerCAmelCase(   self   :  Union[str, Any]						):






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







'''simple docstring'''




from ..utils import DummyObject, requires_backends




class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[int]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[int]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			str      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Union[str, Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Tuple      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[str]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Tuple      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



