





'''simple docstring'''



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


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

__magic_name__   :						str    =			{
    """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       __SCREAMING_SNAKE_CASE	(						__UpperCamelCase			):



     '''simple docstring'''






     UpperCAmelCase__       :						Optional[int]      =   '''speech_to_text'''
     UpperCAmelCase__       :						Tuple      =   ['''past_key_values''']
     UpperCAmelCase__       :						List[Any]      =   {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}

     def __init__(					self						,   lowerCamelCase=10_000						,   lowerCamelCase=12						,   lowerCamelCase=2_048						,   lowerCamelCase=4						,   lowerCamelCase=6						,   lowerCamelCase=2_048						,   lowerCamelCase=4						,   lowerCamelCase=0.0						,   lowerCamelCase=0.0						,   lowerCamelCase=True						,   lowerCamelCase=True						,   lowerCamelCase="relu"						,   lowerCamelCase=256						,   lowerCamelCase=0.1						,   lowerCamelCase=0.0						,   lowerCamelCase=0.0						,   lowerCamelCase=0.02						,   lowerCamelCase=2						,   lowerCamelCase=True						,   lowerCamelCase=1						,   lowerCamelCase=0						,   lowerCamelCase=2						,   lowerCamelCase=6_000						,   lowerCamelCase=1_024						,   lowerCamelCase=2						,   lowerCamelCase=(5, 5)						,   lowerCamelCase=1_024						,   lowerCamelCase=80						,   lowerCamelCase=1						,   **lowerCamelCase						,   ):
       _snake_case     		=				vocab_size
       _snake_case     		=				d_model
       _snake_case     		=				encoder_ffn_dim
       _snake_case     		=				encoder_layers
       _snake_case     		=				encoder_attention_heads
       _snake_case     		=				decoder_ffn_dim
       _snake_case     		=				decoder_layers
       _snake_case     		=				decoder_attention_heads
       _snake_case     		=				dropout
       _snake_case     		=				attention_dropout
       _snake_case     		=				activation_dropout
       _snake_case     		=				activation_function
       _snake_case     		=				init_std
       _snake_case     		=				encoder_layerdrop
       _snake_case     		=				decoder_layerdrop
       _snake_case     		=				use_cache
       _snake_case     		=				encoder_layers
       _snake_case     		=				scale_embedding  # scale factor will be sqrt(d_model) if True
       _snake_case     		=				max_source_positions
       _snake_case     		=				max_target_positions
       _snake_case     		=				num_conv_layers
       _snake_case     		=				list(lowerCamelCase	)
       _snake_case     		=				conv_channels
       _snake_case     		=				input_feat_per_channel
       _snake_case     		=				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=lowerCamelCase						,   bos_token_id=lowerCamelCase						,   eos_token_id=lowerCamelCase						,   is_encoder_decoder=lowerCamelCase						,   decoder_start_token_id=lowerCamelCase						,   **lowerCamelCase						,   )









'''simple docstring'''



from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__magic_name__   :						int    =			logging.get_logger(__name__)

__magic_name__   :						Tuple    =			{
    """xlm-mlm-en-2048""": """https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json""",
    """xlm-mlm-ende-1024""": """https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json""",
    """xlm-mlm-enfr-1024""": """https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json""",
    """xlm-mlm-enro-1024""": """https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json""",
    """xlm-mlm-tlm-xnli15-1024""": """https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json""",
    """xlm-mlm-xnli15-1024""": """https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json""",
    """xlm-clm-enfr-1024""": """https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json""",
    """xlm-clm-ende-1024""": """https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json""",
    """xlm-mlm-17-1280""": """https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json""",
    """xlm-mlm-100-1280""": """https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json""",
}


class       __SCREAMING_SNAKE_CASE	(						__UpperCamelCase			):



     '''simple docstring'''






     UpperCAmelCase__       :						Union[str, Any]      =   '''xlm'''
     UpperCAmelCase__       :						Dict      =   {
         '''hidden_size''': '''emb_dim''',
         '''num_attention_heads''': '''n_heads''',
         '''num_hidden_layers''': '''n_layers''',
         '''n_words''': '''vocab_size''',  # For backward compatibility
     }

     def __init__(					self						,   lowerCamelCase=30_145						,   lowerCamelCase=2_048						,   lowerCamelCase=12						,   lowerCamelCase=16						,   lowerCamelCase=0.1						,   lowerCamelCase=0.1						,   lowerCamelCase=True						,   lowerCamelCase=False						,   lowerCamelCase=False						,   lowerCamelCase=False						,   lowerCamelCase=1						,   lowerCamelCase=True						,   lowerCamelCase=512						,   lowerCamelCase=2_048**-0.5						,   lowerCamelCase=1e-12						,   lowerCamelCase=0.02						,   lowerCamelCase=0						,   lowerCamelCase=1						,   lowerCamelCase=2						,   lowerCamelCase=3						,   lowerCamelCase=5						,   lowerCamelCase=True						,   lowerCamelCase="first"						,   lowerCamelCase=True						,   lowerCamelCase=None						,   lowerCamelCase=True						,   lowerCamelCase=0.1						,   lowerCamelCase=5						,   lowerCamelCase=5						,   lowerCamelCase=0						,   lowerCamelCase=0						,   lowerCamelCase=2						,   lowerCamelCase=0						,   **lowerCamelCase						,   ):
       _snake_case     		=				vocab_size
       _snake_case     		=				emb_dim
       _snake_case     		=				n_layers
       _snake_case     		=				n_heads
       _snake_case     		=				dropout
       _snake_case     		=				attention_dropout
       _snake_case     		=				gelu_activation
       _snake_case     		=				sinusoidal_embeddings
       _snake_case     		=				causal
       _snake_case     		=				asm
       _snake_case     		=				n_langs
       _snake_case     		=				use_lang_emb
       _snake_case     		=				layer_norm_eps
       _snake_case     		=				bos_index
       _snake_case     		=				eos_index
       _snake_case     		=				pad_index
       _snake_case     		=				unk_index
       _snake_case     		=				mask_index
       _snake_case     		=				is_encoder
       _snake_case     		=				max_position_embeddings
       _snake_case     		=				embed_init_std
       _snake_case     		=				init_std
       _snake_case     		=				summary_type
       _snake_case     		=				summary_use_proj
       _snake_case     		=				summary_activation
       _snake_case     		=				summary_proj_to_labels
       _snake_case     		=				summary_first_dropout
       _snake_case     		=				start_n_top
       _snake_case     		=				end_n_top
       _snake_case     		=				mask_token_id
       _snake_case     		=				lang_id

       if "n_words" in kwargs:
         _snake_case     		=				kwargs["n_words"]

       super().__init__(pad_token_id=lowerCamelCase						,   bos_token_id=lowerCamelCase						,   **lowerCamelCase	)







class       __SCREAMING_SNAKE_CASE	(						__UpperCamelCase			):



     '''simple docstring'''






     @property
     def 	UpperCamelCase(					self	):
       if self.task == "multiple-choice":
         _snake_case     		=				{0: "batch", 1: "choice", 2: "sequence"}
       else:
         _snake_case     		=				{0: "batch", 1: "sequence"}
       return OrderedDict(
           [
               ("input_ids", dynamic_axis),
               ("attention_mask", dynamic_axis),
               ("token_type_ids", dynamic_axis),
           ]	)


