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


lowercase   =	logging.get_logger(__name__)

lowercase   =	{
    '''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    __A(					UpperCAmelCase							):
					SCREAMING_SNAKE_CASE           =     '''speech_to_text'''
					SCREAMING_SNAKE_CASE           =     ['''past_key_values''']
					SCREAMING_SNAKE_CASE           =     {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}

					def __init__(						self       :  str ,       __UpperCamelCase       :  Tuple=1_0_0_0_0 ,       __UpperCamelCase       :  Union[str, Any]=1_2 ,       __UpperCamelCase       :  str=2_0_4_8 ,       __UpperCamelCase       :  Tuple=4 ,       __UpperCamelCase       :  int=6 ,       __UpperCamelCase       :  Dict=2_0_4_8 ,       __UpperCamelCase       :  Any=4 ,       __UpperCamelCase       :  Any=0.0 ,       __UpperCamelCase       :  Optional[int]=0.0 ,       __UpperCamelCase       :  Tuple=True ,       __UpperCamelCase       :  List[Any]=True ,       __UpperCamelCase       :  Union[str, Any]="relu" ,       __UpperCamelCase       :  Optional[int]=2_5_6 ,       __UpperCamelCase       :  str=0.1 ,       __UpperCamelCase       :  List[Any]=0.0 ,       __UpperCamelCase       :  Tuple=0.0 ,       __UpperCamelCase       :  Union[str, Any]=0.02 ,       __UpperCamelCase       :  str=2 ,       __UpperCamelCase       :  Dict=True ,       __UpperCamelCase       :  List[Any]=1 ,       __UpperCamelCase       :  List[str]=0 ,       __UpperCamelCase       :  Union[str, Any]=2 ,       __UpperCamelCase       :  Optional[Any]=6_0_0_0 ,       __UpperCamelCase       :  List[Any]=1_0_2_4 ,       __UpperCamelCase       :  Optional[int]=2 ,       __UpperCamelCase       :  int=(5, 5) ,       __UpperCamelCase       :  Any=1_0_2_4 ,       __UpperCamelCase       :  Any=8_0 ,       __UpperCamelCase       :  Dict=1 ,       **__UpperCamelCase       :  Optional[int] ,       ):
												lowerCamelCase_					=       vocab_size
												lowerCamelCase_					=       d_model
												lowerCamelCase_					=       encoder_ffn_dim
												lowerCamelCase_					=       encoder_layers
												lowerCamelCase_					=       encoder_attention_heads
												lowerCamelCase_					=       decoder_ffn_dim
												lowerCamelCase_					=       decoder_layers
												lowerCamelCase_					=       decoder_attention_heads
												lowerCamelCase_					=       dropout
												lowerCamelCase_					=       attention_dropout
												lowerCamelCase_					=       activation_dropout
												lowerCamelCase_					=       activation_function
												lowerCamelCase_					=       init_std
												lowerCamelCase_					=       encoder_layerdrop
												lowerCamelCase_					=       decoder_layerdrop
												lowerCamelCase_					=       use_cache
												lowerCamelCase_					=       encoder_layers
												lowerCamelCase_					=       scale_embedding  # scale factor will be sqrt(d_model) if True
												lowerCamelCase_					=       max_source_positions
												lowerCamelCase_					=       max_target_positions
												lowerCamelCase_					=       num_conv_layers
												lowerCamelCase_					=       list(__UpperCamelCase )
												lowerCamelCase_					=       conv_channels
												lowerCamelCase_					=       input_feat_per_channel
												lowerCamelCase_					=       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 ,       )







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


lowercase   =	{
    '''configuration_layoutlmv2''': ['''LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LayoutLMv2Config'''],
    '''processing_layoutlmv2''': ['''LayoutLMv2Processor'''],
    '''tokenization_layoutlmv2''': ['''LayoutLMv2Tokenizer'''],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase   =	['''LayoutLMv2TokenizerFast''']

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase   =	['''LayoutLMv2FeatureExtractor''']
		lowercase   =	['''LayoutLMv2ImageProcessor''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase   =	[
		    '''LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''LayoutLMv2ForQuestionAnswering''',
		    '''LayoutLMv2ForSequenceClassification''',
		    '''LayoutLMv2ForTokenClassification''',
		    '''LayoutLMv2Layer''',
		    '''LayoutLMv2Model''',
		    '''LayoutLMv2PreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_layoutlmva import LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMvaConfig
		from .processing_layoutlmva import LayoutLMvaProcessor
		from .tokenization_layoutlmva import LayoutLMvaTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_layoutlmva_fast import LayoutLMvaTokenizerFast

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_layoutlmva import LayoutLMvaFeatureExtractor, LayoutLMvaImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_layoutlmva import (
				    LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LayoutLMvaForQuestionAnswering,
				    LayoutLMvaForSequenceClassification,
				    LayoutLMvaForTokenClassification,
				    LayoutLMvaLayer,
				    LayoutLMvaModel,
				    LayoutLMvaPreTrainedModel,
				)
else:
		import sys

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





