






'''simple docstring'''



from typing import Mapping

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


__UpperCamelCase      :       str      			=      logging.get_logger(__name__)

__UpperCamelCase      :       int      			=      {
    """google/umt5-small""": """https://huggingface.co/google/umt5-small/resolve/main/config.json""",
    # See all umt5 models at https://huggingface.co/models?filter=umt5
}
class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):
      __a  					="umt5"
      __a  					=["past_key_values"]




      def __init__(  self ,   lowerCamelCase=25_0112 ,   lowerCamelCase=512 ,   lowerCamelCase=64 ,   lowerCamelCase=1024 ,   lowerCamelCase=8 ,   lowerCamelCase=None ,   lowerCamelCase=6 ,   lowerCamelCase=32 ,   lowerCamelCase=128 ,   lowerCamelCase=0.1 ,   lowerCamelCase=1e-6 ,   lowerCamelCase=1.0 ,   lowerCamelCase="gated-gelu" ,   lowerCamelCase=True ,   lowerCamelCase=True ,   lowerCamelCase="T5Tokenizer" ,   lowerCamelCase=True ,   lowerCamelCase=0 ,   lowerCamelCase=1 ,   lowerCamelCase=0 ,   **lowerCamelCase ,   )							->Dict:



         '''simple docstring'''
         super().__init__(
             is_encoder_decoder=lowerCamelCase ,   tokenizer_class=lowerCamelCase ,   tie_word_embeddings=lowerCamelCase ,   pad_token_id=lowerCamelCase ,   eos_token_id=lowerCamelCase ,   decoder_start_token_id=lowerCamelCase ,   **lowerCamelCase ,   )
         __a				     =    vocab_size
         __a				     =    d_model
         __a				     =    d_kv
         __a				     =    d_ff
         __a				     =    num_layers
         __a				     =    (
             num_decoder_layers if num_decoder_layers is not None else self.num_layers
         )  # default = symmetry
         __a				     =    num_heads
         __a				     =    relative_attention_num_buckets
         __a				     =    relative_attention_max_distance
         __a				     =    dropout_rate
         __a				     =    layer_norm_epsilon
         __a				     =    initializer_factor
         __a				     =    feed_forward_proj
         __a				     =    use_cache

         __a				     =    self.feed_forward_proj.split('-'      )
         __a				     =    act_info[-1]
         __a				     =    act_info[0] == 'gated'

         if len(lowerCamelCase      ) > 1 and act_info[0] != "gated" or len(lowerCamelCase      ) > 2:
            raise ValueError(
                F"""`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer."""
                'Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. '
                '\'gated-gelu\' or \'relu\''      )

         if feed_forward_proj == "gated-gelu":
            __a				     =    'gelu_new'




      @property
      def  __UpperCamelCase							(  self      )							->int:



         '''simple docstring'''
         return self.d_model




      @property
      def  __UpperCamelCase							(  self      )							->Dict:



         '''simple docstring'''
         return self.num_heads






      @property
      def  __UpperCamelCase							(  self      )							->List[Any]:



         '''simple docstring'''
         return self.num_layers







class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):




      @property
      # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.inputs
      def  __UpperCamelCase							(  self      )							->Mapping[str, Mapping[int, str]]:



         '''simple docstring'''
         __a				     =    {
             'input_ids': {0: 'batch', 1: 'encoder_sequence'},
             'attention_mask': {0: 'batch', 1: 'encoder_sequence'},
         }
         if self.use_past:
            __a				     =    'past_encoder_sequence + sequence'
            __a				     =    {0: 'batch'}
            __a				     =    {0: 'batch', 1: 'past_decoder_sequence + sequence'}
         else:
            __a				     =    {0: 'batch', 1: 'decoder_sequence'}
            __a				     =    {0: 'batch', 1: 'decoder_sequence'}

         if self.use_past:
            self.fill_with_past_key_values_(lowerCamelCase ,   direction='inputs'      )

         return common_inputs




      @property
      # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.default_onnx_opset
      def  __UpperCamelCase							(  self      )							->int:



         '''simple docstring'''
         return 13






      @property
      def  __UpperCamelCase							(  self      )							->float:



         '''simple docstring'''
         return 5e-4







'''simple docstring'''



from collections import OrderedDict
from typing import Mapping

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


__UpperCamelCase      :       Dict      			=      logging.get_logger(__name__)

__UpperCamelCase      :       Optional[int]      			=      {
    """facebook/xmod-base""": """https://huggingface.co/facebook/xmod-base/resolve/main/config.json""",
    """facebook/xmod-large-prenorm""": """https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json""",
    """facebook/xmod-base-13-125k""": """https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json""",
    """facebook/xmod-base-30-125k""": """https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json""",
    """facebook/xmod-base-30-195k""": """https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json""",
    """facebook/xmod-base-60-125k""": """https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json""",
    """facebook/xmod-base-60-265k""": """https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json""",
    """facebook/xmod-base-75-125k""": """https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json""",
    """facebook/xmod-base-75-269k""": """https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json""",
}
class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):
      __a  					="xmod"




      def __init__(  self ,   lowerCamelCase=3_0522 ,   lowerCamelCase=768 ,   lowerCamelCase=12 ,   lowerCamelCase=12 ,   lowerCamelCase=3072 ,   lowerCamelCase="gelu" ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.1 ,   lowerCamelCase=512 ,   lowerCamelCase=2 ,   lowerCamelCase=0.02 ,   lowerCamelCase=1e-12 ,   lowerCamelCase=1 ,   lowerCamelCase=0 ,   lowerCamelCase=2 ,   lowerCamelCase="absolute" ,   lowerCamelCase=True ,   lowerCamelCase=None ,   lowerCamelCase=False ,   lowerCamelCase=2 ,   lowerCamelCase=False ,   lowerCamelCase=True ,   lowerCamelCase=True ,   lowerCamelCase=("en_XX",) ,   lowerCamelCase=None ,   **lowerCamelCase ,   )							->Any:



         '''simple docstring'''
         super().__init__(pad_token_id=lowerCamelCase ,   bos_token_id=lowerCamelCase ,   eos_token_id=lowerCamelCase ,   **lowerCamelCase      )

         __a				     =    vocab_size
         __a				     =    hidden_size
         __a				     =    num_hidden_layers
         __a				     =    num_attention_heads
         __a				     =    hidden_act
         __a				     =    intermediate_size
         __a				     =    hidden_dropout_prob
         __a				     =    attention_probs_dropout_prob
         __a				     =    max_position_embeddings
         __a				     =    type_vocab_size
         __a				     =    initializer_range
         __a				     =    layer_norm_eps
         __a				     =    position_embedding_type
         __a				     =    use_cache
         __a				     =    classifier_dropout
         __a				     =    pre_norm
         __a				     =    adapter_reduction_factor
         __a				     =    adapter_layer_norm
         __a				     =    adapter_reuse_layer_norm
         __a				     =    ln_before_adapter
         __a				     =    list(lowerCamelCase      )
         __a				     =    default_language







class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):




      @property
      def  __UpperCamelCase							(  self      )							->Mapping[str, Mapping[int, str]]:



         '''simple docstring'''
         if self.task == "multiple-choice":
            __a				     =    {0: 'batch', 1: 'choice', 2: 'sequence'}
         else:
            __a				     =    {0: 'batch', 1: 'sequence'}
         return OrderedDict(
             [
                 ('input_ids', dynamic_axis),
                 ('attention_mask', dynamic_axis),
             ]      )