


'''simple docstring'''



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


__UpperCAmelCase    :Union[str, Any]				       =     logging.get_logger(__name__)

__UpperCAmelCase    :Tuple				       =     {
    """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       (	_a ):


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				List[Any]							     =     "speech_to_text"
     SCREAMING_SNAKE_CASE :				int							     =     ["past_key_values"]
     SCREAMING_SNAKE_CASE :				Optional[int]							     =     {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}

     def __init__(       self  :	int							,				snake_case  :	int=1_0000							,				snake_case  :	List[str]=12							,				snake_case  :	Optional[int]=2048							,				snake_case  :	List[Any]=4							,				snake_case  :	Optional[Any]=6							,				snake_case  :	List[str]=2048							,				snake_case  :	str=4							,				snake_case  :	Dict=0.0							,				snake_case  :	List[Any]=0.0							,				snake_case  :	Optional[int]=True							,				snake_case  :	str=True							,				snake_case  :	Optional[Any]="relu"							,				snake_case  :	Optional[Any]=256							,				snake_case  :	Union[str, Any]=0.1							,				snake_case  :	str=0.0							,				snake_case  :	Dict=0.0							,				snake_case  :	Tuple=0.02							,				snake_case  :	Dict=2							,				snake_case  :	int=True							,				snake_case  :	Optional[Any]=1							,				snake_case  :	int=0							,				snake_case  :	Dict=2							,				snake_case  :	Dict=6000							,				snake_case  :	Optional[int]=1024							,				snake_case  :	Any=2							,				snake_case  :	int=(5, 5)							,				snake_case  :	Dict=1024							,				snake_case  :	List[str]=80							,				snake_case  :	List[str]=1							,				**snake_case  :	Any							,				)		->							List[Any]:
          __UpperCAmelCase			:				Any													=    vocab_size
          __UpperCAmelCase			:				Tuple													=    d_model
          __UpperCAmelCase			:				Optional[Any]													=    encoder_ffn_dim
          __UpperCAmelCase			:				List[str]													=    encoder_layers
          __UpperCAmelCase			:				List[str]													=    encoder_attention_heads
          __UpperCAmelCase			:				int													=    decoder_ffn_dim
          __UpperCAmelCase			:				Any													=    decoder_layers
          __UpperCAmelCase			:				Dict													=    decoder_attention_heads
          __UpperCAmelCase			:				List[str]													=    dropout
          __UpperCAmelCase			:				int													=    attention_dropout
          __UpperCAmelCase			:				str													=    activation_dropout
          __UpperCAmelCase			:				Optional[int]													=    activation_function
          __UpperCAmelCase			:				Tuple													=    init_std
          __UpperCAmelCase			:				Optional[int]													=    encoder_layerdrop
          __UpperCAmelCase			:				int													=    decoder_layerdrop
          __UpperCAmelCase			:				List[Any]													=    use_cache
          __UpperCAmelCase			:				Tuple													=    encoder_layers
          __UpperCAmelCase			:				Optional[int]													=    scale_embedding  # scale factor will be sqrt(d_model) if True
          __UpperCAmelCase			:				Any													=    max_source_positions
          __UpperCAmelCase			:				Optional[Any]													=    max_target_positions
          __UpperCAmelCase			:				Any													=    num_conv_layers
          __UpperCAmelCase			:				Union[str, Any]													=    list(snake_case    )
          __UpperCAmelCase			:				Union[str, Any]													=    conv_channels
          __UpperCAmelCase			:				Optional[Any]													=    input_feat_per_channel
          __UpperCAmelCase			:				Any													=    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=snake_case							,				bos_token_id=snake_case							,				eos_token_id=snake_case							,				is_encoder_decoder=snake_case							,				decoder_start_token_id=snake_case							,				**snake_case							,				)



'''simple docstring'''



from typing import TYPE_CHECKING

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


__UpperCAmelCase    :Optional[Any]				       =     {
    "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:
      __UpperCAmelCase    :Any				       =     ["LayoutLMv2TokenizerFast"]

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase    :int				       =     ["LayoutLMv2FeatureExtractor"]
      __UpperCAmelCase    :Optional[int]				       =     ["LayoutLMv2ImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase    :List[Any]				       =     [
          "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

      __UpperCAmelCase    :Any				       =     _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)