






from collections import OrderedDict
from typing import Mapping

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


__lowerCamelCase      :    List[str]   		=   logging.get_logger(__name__)

__lowerCamelCase      :    str   		=   {
    "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json",
    "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json",
    # See all XLM-RoBERTa-XL models at https://huggingface.co/models?filter=xlm-roberta-xl
}



class 							SCREAMING_SNAKE_CASE__		(       __UpperCAmelCase		):





     """simple docstring"""






     a_			=	"xlm-roberta-xl"



     def __init__(      self  :						List[str]							,	__A  :						Dict=2_5_0_8_8_0							,	__A  :						int=2_5_6_0							,	__A  :						Optional[int]=3_6							,	__A  :						Union[str, Any]=3_2							,	__A  :						str=1_0_2_4_0							,	__A  :						str="gelu"							,	__A  :						Dict=0.1							,	__A  :						List[Any]=0.1							,	__A  :						Optional[Any]=5_1_4							,	__A  :						List[Any]=1							,	__A  :						int=0.0_2							,	__A  :						Optional[int]=1e-0_5							,	__A  :						Dict=1							,	__A  :						str=0							,	__A  :						Union[str, Any]=2							,	__A  :						List[str]="absolute"							,	__A  :						Dict=True							,	__A  :						Dict=None							,	**__A  :						str							,	):
      super().__init__(pad_token_id=lowerCAmelCase_							,	bos_token_id=lowerCAmelCase_							,	eos_token_id=lowerCAmelCase_							,	**lowerCAmelCase_ )
      snake_case__				:   Union[str, Any]     =						vocab_size
      snake_case__				:   Optional[int]     =						hidden_size
      snake_case__				:   str     =						num_hidden_layers
      snake_case__				:   Any     =						num_attention_heads
      snake_case__				:   Union[str, Any]     =						hidden_act
      snake_case__				:   Any     =						intermediate_size
      snake_case__				:   int     =						hidden_dropout_prob
      snake_case__				:   Union[str, Any]     =						attention_probs_dropout_prob
      snake_case__				:   Optional[int]     =						max_position_embeddings
      snake_case__				:   Dict     =						type_vocab_size
      snake_case__				:   Optional[Any]     =						initializer_range
      snake_case__				:   int     =						layer_norm_eps
      snake_case__				:   str     =						position_embedding_type
      snake_case__				:   Optional[int]     =						use_cache
      snake_case__				:   List[str]     =						classifier_dropout



class 							SCREAMING_SNAKE_CASE__		(       __UpperCAmelCase		):





     """simple docstring"""






     @property
     def  _lowercase  (      self  :						Union[str, Any] ):







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











from typing import TYPE_CHECKING

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


__lowerCamelCase      :    List[str]   		=   {"""configuration_xlnet""": ["""XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """XLNetConfig"""]}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase      :    str   		=   ["""XLNetTokenizer"""]

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase      :    Dict   		=   ["""XLNetTokenizerFast"""]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase      :    str   		=   [
	    """XLNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """XLNetForMultipleChoice""",
	    """XLNetForQuestionAnswering""",
	    """XLNetForQuestionAnsweringSimple""",
	    """XLNetForSequenceClassification""",
	    """XLNetForTokenClassification""",
	    """XLNetLMHeadModel""",
	    """XLNetModel""",
	    """XLNetPreTrainedModel""",
	    """load_tf_weights_in_xlnet""",
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase      :    Dict   		=   [
	    """TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """TFXLNetForMultipleChoice""",
	    """TFXLNetForQuestionAnsweringSimple""",
	    """TFXLNetForSequenceClassification""",
	    """TFXLNetForTokenClassification""",
	    """TFXLNetLMHeadModel""",
	    """TFXLNetMainLayer""",
	    """TFXLNetModel""",
	    """TFXLNetPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_xlnet import XLNetTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_xlnet_fast import XLNetTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_xlnet import (
		    XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
		    XLNetForMultipleChoice,
		    XLNetForQuestionAnswering,
		    XLNetForQuestionAnsweringSimple,
		    XLNetForSequenceClassification,
		    XLNetForTokenClassification,
		    XLNetLMHeadModel,
		    XLNetModel,
		    XLNetPreTrainedModel,
		    load_tf_weights_in_xlnet,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_xlnet import (
		    TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFXLNetForMultipleChoice,
		    TFXLNetForQuestionAnsweringSimple,
		    TFXLNetForSequenceClassification,
		    TFXLNetForTokenClassification,
		    TFXLNetLMHeadModel,
		    TFXLNetMainLayer,
		    TFXLNetModel,
		    TFXLNetPreTrainedModel,
		)

else:
	import sys

	__lowerCamelCase      :    int   		=   _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



