





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


A	     =					logging.get_logger(__name__)

A	     =					{
    '''facebook/s2t-small-librispeech-asr''': (
        '''https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json'''
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}




class 			__lowercase     (     _UpperCamelCase							):







					'''simple docstring'''




					__lowerCAmelCase					=					'''speech_to_text'''
					__lowerCAmelCase					=					['''past_key_values''']
					__lowerCAmelCase					=					{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}







					def __init__(  self		,     _UpperCAmelCase=10000		,     _UpperCAmelCase=12		,     _UpperCAmelCase=2048		,     _UpperCAmelCase=4		,     _UpperCAmelCase=6		,     _UpperCAmelCase=2048		,     _UpperCAmelCase=4		,     _UpperCAmelCase=0.0		,     _UpperCAmelCase=0.0		,     _UpperCAmelCase=True		,     _UpperCAmelCase=True		,     _UpperCAmelCase="relu"		,     _UpperCAmelCase=256		,     _UpperCAmelCase=0.1		,     _UpperCAmelCase=0.0		,     _UpperCAmelCase=0.0		,     _UpperCAmelCase=0.0_2		,     _UpperCAmelCase=2		,     _UpperCAmelCase=True		,     _UpperCAmelCase=1		,     _UpperCAmelCase=0		,     _UpperCAmelCase=2		,     _UpperCAmelCase=6000		,     _UpperCAmelCase=1024		,     _UpperCAmelCase=2		,     _UpperCAmelCase=(5, 5)		,     _UpperCAmelCase=1024		,     _UpperCAmelCase=80		,     _UpperCAmelCase=1		,     **_UpperCAmelCase		,     ):
									__a	:  Tuple         =					vocab_size
									__a	:  Tuple         =					d_model
									__a	:  List[Any]         =					encoder_ffn_dim
									__a	:  str         =					encoder_layers
									__a	:  str         =					encoder_attention_heads
									__a	:  Tuple         =					decoder_ffn_dim
									__a	:  Dict         =					decoder_layers
									__a	:  Any         =					decoder_attention_heads
									__a	:  List[Any]         =					dropout
									__a	:  Tuple         =					attention_dropout
									__a	:  str         =					activation_dropout
									__a	:  Dict         =					activation_function
									__a	:  Any         =					init_std
									__a	:  Any         =					encoder_layerdrop
									__a	:  str         =					decoder_layerdrop
									__a	:  int         =					use_cache
									__a	:  Any         =					encoder_layers
									__a	:  List[str]         =					scale_embedding  # scale factor will be sqrt(d_model) if True
									__a	:  Any         =					max_source_positions
									__a	:  Dict         =					max_target_positions
									__a	:  Union[str, Any]         =					num_conv_layers
									__a	:  List[str]         =					list(_UpperCAmelCase       )
									__a	:  Optional[Any]         =					conv_channels
									__a	:  int         =					input_feat_per_channel
									__a	:  Optional[int]         =					input_channels

									if len(self.conv_kernel_sizes       ) != self.num_conv_layers:
													raise ValueError(
													    '''Configuration for convolutional module is incorrect. '''
													    '''It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '''
													    f"""but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes       )}`, """
													    f"""`config.num_conv_layers = {self.num_conv_layers}`."""       )

									super().__init__(
									    pad_token_id=_UpperCAmelCase		,     bos_token_id=_UpperCAmelCase		,     eos_token_id=_UpperCAmelCase		,     is_encoder_decoder=_UpperCAmelCase		,     decoder_start_token_id=_UpperCAmelCase		,     **_UpperCAmelCase		,     )






"""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__)