





"""simple docstring"""





import warnings

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


__A											=						logging.get_logger(__name__)

__A											=						{
    """RUCAIBox/mvp""": """https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json""",
}






class    _lowerCAmelCase  (	a			):
       """simple docstring"""




       __magic_name__	:Tuple						    =   """mvp"""
       __magic_name__	:Optional[Any]						    =   ["""past_key_values"""]
       __magic_name__	:str						    =   {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}






       def __init__(       self       ,					__UpperCAmelCase=5_0_2_6_7       ,					__UpperCAmelCase=1_0_2_4       ,					__UpperCAmelCase=1_2       ,					__UpperCAmelCase=4_0_9_6       ,					__UpperCAmelCase=1_6       ,					__UpperCAmelCase=1_2       ,					__UpperCAmelCase=4_0_9_6       ,					__UpperCAmelCase=1_6       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase="gelu"       ,					__UpperCAmelCase=1_0_2_4       ,					__UpperCAmelCase=0.1       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase=0.02       ,					__UpperCAmelCase=0.0       ,					__UpperCAmelCase=False       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=1       ,					__UpperCAmelCase=0       ,					__UpperCAmelCase=2       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=2       ,					__UpperCAmelCase=2       ,					__UpperCAmelCase=False       ,					__UpperCAmelCase=1_0_0       ,					__UpperCAmelCase=8_0_0       ,					**__UpperCAmelCase       ,					):



         '''simple docstring'''

         lowerCAmelCase__     :str											=				vocab_size
         lowerCAmelCase__     :List[Any]											=				max_position_embeddings
         lowerCAmelCase__     :List[str]											=				d_model
         lowerCAmelCase__     :Optional[int]											=				encoder_ffn_dim
         lowerCAmelCase__     :Dict											=				encoder_layers
         lowerCAmelCase__     :Optional[int]											=				encoder_attention_heads
         lowerCAmelCase__     :Dict											=				decoder_ffn_dim
         lowerCAmelCase__     :Optional[int]											=				decoder_layers
         lowerCAmelCase__     :List[Any]											=				decoder_attention_heads
         lowerCAmelCase__     :List[Any]											=				dropout
         lowerCAmelCase__     :Optional[Any]											=				attention_dropout
         lowerCAmelCase__     :int											=				activation_dropout
         lowerCAmelCase__     :List[str]											=				activation_function
         lowerCAmelCase__     :Any											=				init_std
         lowerCAmelCase__     :List[str]											=				encoder_layerdrop
         lowerCAmelCase__     :Optional[Any]											=				decoder_layerdrop
         lowerCAmelCase__     :Tuple											=				classifier_dropout
         lowerCAmelCase__     :Any											=				use_cache
         lowerCAmelCase__     :Tuple											=				encoder_layers
         lowerCAmelCase__     :str											=				scale_embedding  # scale factor will be sqrt(d_model) if True
         lowerCAmelCase__     :Any											=				use_prompt
         lowerCAmelCase__     :List[Any]											=				prompt_length
         lowerCAmelCase__     :Dict											=				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 ):
           lowerCAmelCase__     :str											=				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.' )






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


if is_sentencepiece_available():
   from ..ta.tokenization_ta import TaTokenizer
else:
   from ...utils.dummy_sentencepiece_objects import TaTokenizer

lowerCamelCase__					:  List[Any]      							=				TaTokenizer

if is_tokenizers_available():
   from ..ta.tokenization_ta_fast import TaTokenizerFast
else:
   from ...utils.dummy_tokenizers_objects import TaTokenizerFast

lowerCamelCase__					:  Union[str, Any]      							=				TaTokenizerFast

lowerCamelCase__					:  Dict      							=				{'configuration_mt5': ['MT5Config', 'MT5OnnxConfig']}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__					:  Tuple      							=				[
       'MT5EncoderModel',
       'MT5ForConditionalGeneration',
       'MT5ForQuestionAnswering',
       'MT5Model',
       'MT5PreTrainedModel',
       'MT5Stack',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__					:  Tuple      							=				['TFMT5EncoderModel', 'TFMT5ForConditionalGeneration', 'TFMT5Model']

try:
   if not is_flax_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__					:  Tuple      							=				['FlaxMT5EncoderModel', 'FlaxMT5ForConditionalGeneration', 'FlaxMT5Model']


if TYPE_CHECKING:
   from .configuration_mta import MTaConfig, MTaOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_mta import (
          MTaEncoderModel,
          MTaForConditionalGeneration,
          MTaForQuestionAnswering,
          MTaModel,
          MTaPreTrainedModel,
          MTaStack,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_mta import TFMTaEncoderModel, TFMTaForConditionalGeneration, TFMTaModel

   try:
      if not is_flax_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_flax_mta import FlaxMTaEncoderModel, FlaxMTaForConditionalGeneration, FlaxMTaModel

else:
   import sys

   lowerCamelCase__					:  int      							=				_LazyModule(
       __name__,
       globals()['__file__'],
       _import_structure,
       extra_objects={'MT5Tokenizer': MTaTokenizer, 'MT5TokenizerFast': MTaTokenizerFast},
       module_spec=__spec__,
   )