



'''simple docstring'''






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:					str						       =						TaTokenizer

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

lowerCAmelCase:					Tuple						       =						TaTokenizerFast

lowerCAmelCase:					List[Any]						       =						{'configuration_mt5': ['MT5Config', 'MT5OnnxConfig']}

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

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

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase:					Union[str, Any]						       =						['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:					Tuple						       =						_LazyModule(
         __name__,
         globals()['__file__'],
         _import_structure,
         extra_objects={'MT5Tokenizer': MTaTokenizer, 'MT5TokenizerFast': MTaTokenizerFast},
         module_spec=__spec__,
     )




"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCAmelCase    :int     =					logging.get_logger(__name__)

_lowerCAmelCase    :Union[str, Any]     =					{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     a__									='''mgp-str'''





     def __init__(					self       ,	A=[3_2, 1_2_8]       ,	A=4       ,	A=3       ,	A=2_7       ,	A=3_8       ,	A=5_0_2_5_7       ,	A=3_0_5_2_2       ,	A=7_6_8       ,	A=1_2       ,	A=1_2       ,	A=4.0       ,	A=True       ,	A=False       ,	A=1E-5       ,	A=0.0       ,	A=0.0       ,	A=0.0       ,	A=False       ,	A=0.02       ,	**A       ,	)							->					Union[str, Any]:
         super().__init__(**A		)

         _UpperCAmelCase							:  Any											=    image_size
         _UpperCAmelCase							:  str											=    patch_size
         _UpperCAmelCase							:  Dict											=    num_channels
         _UpperCAmelCase							:  Dict											=    max_token_length
         _UpperCAmelCase							:  Optional[Any]											=    num_character_labels
         _UpperCAmelCase							:  int											=    num_bpe_labels
         _UpperCAmelCase							:  List[str]											=    num_wordpiece_labels
         _UpperCAmelCase							:  Optional[int]											=    hidden_size
         _UpperCAmelCase							:  Any											=    num_hidden_layers
         _UpperCAmelCase							:  List[Any]											=    num_attention_heads
         _UpperCAmelCase							:  List[Any]											=    mlp_ratio
         _UpperCAmelCase							:  List[str]											=    distilled
         _UpperCAmelCase							:  Optional[int]											=    layer_norm_eps
         _UpperCAmelCase							:  str											=    drop_rate
         _UpperCAmelCase							:  List[Any]											=    qkv_bias
         _UpperCAmelCase							:  List[str]											=    attn_drop_rate
         _UpperCAmelCase							:  Dict											=    drop_path_rate
         _UpperCAmelCase							:  Union[str, Any]											=    output_aa_attentions
         _UpperCAmelCase							:  List[str]											=    initializer_range


