


'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

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


lowerCamelCase							:   Optional[Any]  						=	logging.get_logger(__name__)

lowerCamelCase							:   Dict  						=	{
    '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   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     List[str]  					=							"""xlm"""
      lowerCAmelCase__					:     Any  					=							{
          """hidden_size""": """emb_dim""",
          """num_attention_heads""": """n_heads""",
          """num_hidden_layers""": """n_layers""",
          """n_words""": """vocab_size""",  # For backward compatibility
      }



      def __init__(self    :    Union[str, Any]   ,						UpperCamelCase    :    Union[str, Any]=30145   ,						UpperCamelCase    :    Union[str, Any]=2048   ,						UpperCamelCase    :    Union[str, Any]=12   ,						UpperCamelCase    :    List[str]=16   ,						UpperCamelCase    :    Any=0.1   ,						UpperCamelCase    :    List[str]=0.1   ,						UpperCamelCase    :    List[Any]=True   ,						UpperCamelCase    :    Dict=False   ,						UpperCamelCase    :    Union[str, Any]=False   ,						UpperCamelCase    :    Dict=False   ,						UpperCamelCase    :    List[Any]=1   ,						UpperCamelCase    :    Dict=True   ,						UpperCamelCase    :    int=512   ,						UpperCamelCase    :    int=2048**-0.5   ,						UpperCamelCase    :    Dict=1E-12   ,						UpperCamelCase    :    List[Any]=0.02   ,						UpperCamelCase    :    int=0   ,						UpperCamelCase    :    Any=1   ,						UpperCamelCase    :    Optional[Any]=2   ,						UpperCamelCase    :    Optional[Any]=3   ,						UpperCamelCase    :    str=5   ,						UpperCamelCase    :    Union[str, Any]=True   ,						UpperCamelCase    :    Tuple="first"   ,						UpperCamelCase    :    int=True   ,						UpperCamelCase    :    int=None   ,						UpperCamelCase    :    List[str]=True   ,						UpperCamelCase    :    Optional[int]=0.1   ,						UpperCamelCase    :    int=5   ,						UpperCamelCase    :    int=5   ,						UpperCamelCase    :    List[Any]=0   ,						UpperCamelCase    :    Any=0   ,						UpperCamelCase    :    str=2   ,						UpperCamelCase    :    List[str]=0   ,						**UpperCamelCase    :    Optional[Any]   ,						):

             '''simple docstring'''







             lowercase__      			= vocab_size
             lowercase__      			= emb_dim
             lowercase__      			= n_layers
             lowercase__      			= n_heads
             lowercase__      			= dropout
             lowercase__      			= attention_dropout
             lowercase__      			= gelu_activation
             lowercase__      			= sinusoidal_embeddings
             lowercase__      			= causal
             lowercase__      			= asm
             lowercase__      			= n_langs
             lowercase__      			= use_lang_emb
             lowercase__      			= layer_norm_eps
             lowercase__      			= bos_index
             lowercase__      			= eos_index
             lowercase__      			= pad_index
             lowercase__      			= unk_index
             lowercase__      			= mask_index
             lowercase__      			= is_encoder
             lowercase__      			= max_position_embeddings
             lowercase__      			= embed_init_std
             lowercase__      			= init_std
             lowercase__      			= summary_type
             lowercase__      			= summary_use_proj
             lowercase__      			= summary_activation
             lowercase__      			= summary_proj_to_labels
             lowercase__      			= summary_first_dropout
             lowercase__      			= start_n_top
             lowercase__      			= end_n_top
             lowercase__      			= mask_token_id
             lowercase__      			= lang_id

             if "n_words" in kwargs:
                    lowercase__      			= kwargs['''n_words''']

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






class   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      @property
      def       UpperCamelCase__		(self    :    int ):

             '''simple docstring'''







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








'''simple docstring'''

import warnings

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


lowerCamelCase							:   str  						=	logging.get_logger(__name__)

lowerCamelCase							:   int  						=	{
    'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json',
}
class   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     Union[str, Any]  					=							"""mvp"""
      lowerCAmelCase__					:     Optional[Any]  					=							["""past_key_values"""]
      lowerCAmelCase__					:     List[str]  					=							{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}



      def __init__(self    :    Any   ,						UpperCamelCase    :    Optional[int]=50267   ,						UpperCamelCase    :    Tuple=1024   ,						UpperCamelCase    :    int=12   ,						UpperCamelCase    :    Tuple=4096   ,						UpperCamelCase    :    Dict=16   ,						UpperCamelCase    :    int=12   ,						UpperCamelCase    :    Optional[int]=4096   ,						UpperCamelCase    :    Optional[int]=16   ,						UpperCamelCase    :    Tuple=0.0   ,						UpperCamelCase    :    Tuple=0.0   ,						UpperCamelCase    :    List[Any]="gelu"   ,						UpperCamelCase    :    Union[str, Any]=1024   ,						UpperCamelCase    :    Optional[Any]=0.1   ,						UpperCamelCase    :    str=0.0   ,						UpperCamelCase    :    str=0.0   ,						UpperCamelCase    :    Optional[Any]=0.02   ,						UpperCamelCase    :    List[str]=0.0   ,						UpperCamelCase    :    List[str]=False   ,						UpperCamelCase    :    Optional[int]=True   ,						UpperCamelCase    :    Any=1   ,						UpperCamelCase    :    int=0   ,						UpperCamelCase    :    int=2   ,						UpperCamelCase    :    Any=True   ,						UpperCamelCase    :    Optional[Any]=2   ,						UpperCamelCase    :    Optional[Any]=2   ,						UpperCamelCase    :    Tuple=False   ,						UpperCamelCase    :    int=100   ,						UpperCamelCase    :    Optional[Any]=800   ,						**UpperCamelCase    :    str   ,						):

             '''simple docstring'''







             lowercase__      			= vocab_size
             lowercase__      			= max_position_embeddings
             lowercase__      			= d_model
             lowercase__      			= encoder_ffn_dim
             lowercase__      			= encoder_layers
             lowercase__      			= encoder_attention_heads
             lowercase__      			= decoder_ffn_dim
             lowercase__      			= decoder_layers
             lowercase__      			= decoder_attention_heads
             lowercase__      			= dropout
             lowercase__      			= attention_dropout
             lowercase__      			= activation_dropout
             lowercase__      			= activation_function
             lowercase__      			= init_std
             lowercase__      			= encoder_layerdrop
             lowercase__      			= decoder_layerdrop
             lowercase__      			= classifier_dropout
             lowercase__      			= use_cache
             lowercase__      			= encoder_layers
             lowercase__      			= scale_embedding  # scale factor will be sqrt(d_model) if True
             lowercase__      			= use_prompt
             lowercase__      			= prompt_length
             lowercase__      			= prompt_mid_dim

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

             if self.forced_bos_token_id is None and kwargs.get('''force_bos_token_to_be_generated'''   ,						UpperCamelCase ):
                    lowercase__      			= self.bos_token_id
                    warnings.warn(
                        f"Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. "
                        '''The config can simply be saved and uploaded again to be fixed.''' )




