



import functools
import operator

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


SCREAMING_SNAKE_CASE_:Optional[Any]					=						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:List[str]					=						{
    """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 SCREAMING_SNAKE_CASE__					(		SCREAMING_SNAKE_CASE__   ):




    '''simple docstring'''






    __lowerCamelCase      :			Optional[Any] =				"unispeech"






    def __init__(	self,		lowerCamelCase__=32,		lowerCamelCase__=768,		lowerCamelCase__=12,		lowerCamelCase__=12,		lowerCamelCase__=3072,		lowerCamelCase__="gelu",		lowerCamelCase__=0.1,		lowerCamelCase__=0.1,		lowerCamelCase__=0.1,		lowerCamelCase__=0.0,		lowerCamelCase__=0.0,		lowerCamelCase__=0.1,		lowerCamelCase__=0.1,		lowerCamelCase__=0.02,		lowerCamelCase__=1e-5,		lowerCamelCase__="group",		lowerCamelCase__="gelu",		lowerCamelCase__=(512, 512, 512, 512, 512, 512, 512),		lowerCamelCase__=(5, 2, 2, 2, 2, 2, 2),		lowerCamelCase__=(10, 3, 3, 3, 3, 2, 2),		lowerCamelCase__=False,		lowerCamelCase__=128,		lowerCamelCase__=16,		lowerCamelCase__=False,		lowerCamelCase__=True,		lowerCamelCase__=0.05,		lowerCamelCase__=10,		lowerCamelCase__=2,		lowerCamelCase__=0.0,		lowerCamelCase__=10,		lowerCamelCase__=0,		lowerCamelCase__=320,		lowerCamelCase__=2,		lowerCamelCase__=0.1,		lowerCamelCase__=100,		lowerCamelCase__=256,		lowerCamelCase__=256,		lowerCamelCase__=0.1,		lowerCamelCase__="mean",		lowerCamelCase__=False,		lowerCamelCase__=False,		lowerCamelCase__=256,		lowerCamelCase__=80,		lowerCamelCase__=0,		lowerCamelCase__=1,		lowerCamelCase__=2,		lowerCamelCase__=0.5,		**lowerCamelCase__,		):
        super().__init__(**lowerCamelCase__,		pad_token_id=lowerCamelCase__,		bos_token_id=lowerCamelCase__,		eos_token_id=lowerCamelCase__		)
        A			:	str										=       hidden_size
        A			:	Optional[Any]										=       feat_extract_norm
        A			:	Union[str, Any]										=       feat_extract_activation
        A			:	Optional[Any]										=       list(lowerCamelCase__		)
        A			:	str										=       list(lowerCamelCase__		)
        A			:	List[Any]										=       list(lowerCamelCase__		)
        A			:	Optional[int]										=       conv_bias
        A			:	List[Any]										=       num_conv_pos_embeddings
        A			:	str										=       num_conv_pos_embedding_groups
        A			:	Union[str, Any]										=       len(self.conv_dim		)
        A			:	Optional[int]										=       num_hidden_layers
        A			:	Any										=       intermediate_size
        A			:	Optional[int]										=       hidden_act
        A			:	str										=       num_attention_heads
        A			:	Optional[Any]										=       hidden_dropout
        A			:	int										=       attention_dropout
        A			:	Any										=       activation_dropout
        A			:	Optional[Any]										=       feat_proj_dropout
        A			:	List[str]										=       final_dropout
        A			:	Optional[Any]										=       layerdrop
        A			:	str										=       layer_norm_eps
        A			:	int										=       initializer_range
        A			:	Tuple										=       num_ctc_classes
        A			:	Union[str, Any]										=       vocab_size
        A			:	Optional[int]										=       do_stable_layer_norm
        A			:	str										=       use_weighted_layer_sum
        A			:	List[str]										=       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
        A			:	int										=       apply_spec_augment
        A			:	Optional[int]										=       mask_time_prob
        A			:	int										=       mask_time_length
        A			:	str										=       mask_time_min_masks
        A			:	List[Any]										=       mask_feature_prob
        A			:	Tuple										=       mask_feature_length
        A			:	int										=       mask_feature_min_masks

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

        # ctc loss
        A			:	List[str]										=       ctc_loss_reduction
        A			:	List[str]										=       ctc_zero_infinity

        # pretraining loss
        A			:	List[Any]										=       replace_prob






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







from argparse import ArgumentParser

from .env import EnvironmentCommand




def      __UpperCamelCase     (  )	->  Dict:



    """simple docstring"""






    A			:	str										=       ArgumentParser("""Diffusers CLI tool"""				,					usage="""diffusers-cli <command> [<args>]"""		)
    A			:	int										=       parser.add_subparsers(help="""diffusers-cli command helpers"""		)

    # Register commands
    EnvironmentCommand.register_subcommand(_lowerCAmelCase		)

    # Let's go
    A			:	str										=       parser.parse_args()

    if not hasattr(_lowerCAmelCase				,					"""func"""		):
        parser.print_help()
        exit(1		)

    # Run
    A			:	Any										=       args.func(_lowerCAmelCase		)
    service.run()


if __name__ == "__main__":
     main()


