

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


lowerCAmelCase							:  List[Any]   	=						logging.get_logger(__name__)

lowerCAmelCase							:  Optional[int]   	=						{"""ctrl""": """https://huggingface.co/ctrl/resolve/main/config.json"""}



class   __lowercase				( UpperCAmelCase_	):




			"""simple docstring"""







			_UpperCAmelCase   :							Dict										=     '''ctrl'''
			_UpperCAmelCase   :							Dict										=     ['''past_key_values''']
			_UpperCAmelCase   :							Optional[int]										=     {
			    '''max_position_embeddings''': '''n_positions''',
			    '''hidden_size''': '''n_embd''',
			    '''num_attention_heads''': '''n_head''',
			    '''num_hidden_layers''': '''n_layer''',
			}



			def __init__( self  :     str   ,						lowerCAmelCase__  :     Tuple=24_6534   ,						lowerCAmelCase__  :     Tuple=256   ,						lowerCAmelCase__  :     List[str]=1280   ,						lowerCAmelCase__  :     List[Any]=8192   ,						lowerCAmelCase__  :     Union[str, Any]=48   ,						lowerCAmelCase__  :     Any=16   ,						lowerCAmelCase__  :     Union[str, Any]=0.1   ,						lowerCAmelCase__  :     Union[str, Any]=0.1   ,						lowerCAmelCase__  :     Any=1E-6   ,						lowerCAmelCase__  :     int=0.02   ,						lowerCAmelCase__  :     Any=True   ,						**lowerCAmelCase__  :     Union[str, Any]   ,						):
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       vocab_size
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       n_positions
									SCREAMING_SNAKE_CASE_: List[Any]  		=       n_embd
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       n_layer
									SCREAMING_SNAKE_CASE_: Tuple  		=       n_head
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       dff
									SCREAMING_SNAKE_CASE_: str  		=       resid_pdrop
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       embd_pdrop
									SCREAMING_SNAKE_CASE_: str  		=       layer_norm_epsilon
									SCREAMING_SNAKE_CASE_: str  		=       initializer_range

									SCREAMING_SNAKE_CASE_: List[Any]  		=       use_cache

									super().__init__(**lowerCAmelCase__)









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

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

lowerCAmelCase							:  Dict   	=						TaTokenizerFast

lowerCAmelCase							:  Optional[int]   	=						{"""configuration_mt5""": ["""MT5Config""", """MT5OnnxConfig"""]}

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






