






'''simple docstring'''
import functools
import operator

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


a_					=	logging.get_logger(__name__)

a_					=	{
    '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 (     lowerCamelCase			):
      snake_case_												=							"""unispeech"""




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

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

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

            # pretraining loss
            SCREAMING_SNAKE_CASE__       :			Tuple													=replace_prob




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







'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_					=	{
    'configuration_instructblip': [
        'INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'InstructBlipConfig',
        'InstructBlipQFormerConfig',
        'InstructBlipVisionConfig',
    ],
    'processing_instructblip': ['InstructBlipProcessor'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_					=	[
      'INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
      'InstructBlipQFormerModel',
      'InstructBlipPreTrainedModel',
      'InstructBlipForConditionalGeneration',
      'InstructBlipVisionModel',
  ]

if TYPE_CHECKING:
  from .configuration_instructblip import (
      INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
      InstructBlipConfig,
      InstructBlipQFormerConfig,
      InstructBlipVisionConfig,
  )
  from .processing_instructblip import InstructBlipProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_instructblip import (
        INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
        InstructBlipForConditionalGeneration,
        InstructBlipPreTrainedModel,
        InstructBlipQFormerModel,
        InstructBlipVisionModel,
    )

else:
  import sys

  a_					=	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)