

from collections import OrderedDict
from typing import Mapping

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


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

_UpperCAmelCase	:     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 				lowercase       ( lowercase_    ):
				__SCREAMING_SNAKE_CASE      :				List[Any]     =    '''xlm'''
				__SCREAMING_SNAKE_CASE      :				List[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   ,     snake_case=3_0145   ,     snake_case=2048   ,     snake_case=12   ,     snake_case=16   ,     snake_case=0.1   ,     snake_case=0.1   ,     snake_case=True   ,     snake_case=False   ,     snake_case=False   ,     snake_case=False   ,     snake_case=1   ,     snake_case=True   ,     snake_case=512   ,     snake_case=2048**-0.5   ,     snake_case=1e-1_2   ,     snake_case=0.02   ,     snake_case=0   ,     snake_case=1   ,     snake_case=2   ,     snake_case=3   ,     snake_case=5   ,     snake_case=True   ,     snake_case="first"   ,     snake_case=True   ,     snake_case=None   ,     snake_case=True   ,     snake_case=0.1   ,     snake_case=5   ,     snake_case=5   ,     snake_case=0   ,     snake_case=0   ,     snake_case=2   ,     snake_case=0   ,     **snake_case   ,     ):
											snake_case_           =					vocab_size
											snake_case_           =					emb_dim
											snake_case_           =					n_layers
											snake_case_           =					n_heads
											snake_case_           =					dropout
											snake_case_           =					attention_dropout
											snake_case_           =					gelu_activation
											snake_case_           =					sinusoidal_embeddings
											snake_case_           =					causal
											snake_case_           =					asm
											snake_case_           =					n_langs
											snake_case_           =					use_lang_emb
											snake_case_           =					layer_norm_eps
											snake_case_           =					bos_index
											snake_case_           =					eos_index
											snake_case_           =					pad_index
											snake_case_           =					unk_index
											snake_case_           =					mask_index
											snake_case_           =					is_encoder
											snake_case_           =					max_position_embeddings
											snake_case_           =					embed_init_std
											snake_case_           =					init_std
											snake_case_           =					summary_type
											snake_case_           =					summary_use_proj
											snake_case_           =					summary_activation
											snake_case_           =					summary_proj_to_labels
											snake_case_           =					summary_first_dropout
											snake_case_           =					start_n_top
											snake_case_           =					end_n_top
											snake_case_           =					mask_token_id
											snake_case_           =					lang_id

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

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







class 				lowercase       ( lowercase_    ):




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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


_UpperCAmelCase	:     Any		       = {
    """configuration_longt5""": ["""LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LongT5Config""", """LongT5OnnxConfig"""],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_UpperCAmelCase	:     Any		       = [
					    """LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """LongT5EncoderModel""",
					    """LongT5ForConditionalGeneration""",
					    """LongT5Model""",
					    """LongT5PreTrainedModel""",
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_UpperCAmelCase	:     Optional[int]		       = [
					    """FlaxLongT5ForConditionalGeneration""",
					    """FlaxLongT5Model""",
					    """FlaxLongT5PreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_longta import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP, LongTaConfig, LongTaOnnxConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_longta import (
										    LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST,
										    LongTaEncoderModel,
										    LongTaForConditionalGeneration,
										    LongTaModel,
										    LongTaPreTrainedModel,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_longta import (
										    FlaxLongTaForConditionalGeneration,
										    FlaxLongTaModel,
										    FlaxLongTaPreTrainedModel,
										)


else:
					import sys

					_UpperCAmelCase	:     Optional[Any]		       = _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




