






from collections import OrderedDict
from typing import Mapping

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


_UpperCAmelCase			:		Tuple   				=    logging.get_logger(__name__)

_UpperCAmelCase			:		Optional[Any]   				=    {
    "xlm-roberta-base": "https://huggingface.co/xlm-roberta-base/resolve/main/config.json",
    "xlm-roberta-large": "https://huggingface.co/xlm-roberta-large/resolve/main/config.json",
    "xlm-roberta-large-finetuned-conll02-dutch": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll02-spanish": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll03-english": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll03-german": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json"
    ),
}
class  lowerCAmelCase_       (				snake_case__					):
       UpperCamelCase_		:Dict		      =    'xlm-roberta'




       def __init__(   self     :   Tuple ,							SCREAMING_SNAKE_CASE_     :   Dict=30_522 ,							SCREAMING_SNAKE_CASE_     :   List[Any]=768 ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=12 ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=12 ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=3_072 ,							SCREAMING_SNAKE_CASE_     :   Any="gelu" ,							SCREAMING_SNAKE_CASE_     :   Union[str, Any]=0.1 ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=0.1 ,							SCREAMING_SNAKE_CASE_     :   List[Any]=512 ,							SCREAMING_SNAKE_CASE_     :   List[Any]=2 ,							SCREAMING_SNAKE_CASE_     :   int=0.02 ,							SCREAMING_SNAKE_CASE_     :   List[Any]=1e-12 ,							SCREAMING_SNAKE_CASE_     :   int=1 ,							SCREAMING_SNAKE_CASE_     :   str=0 ,							SCREAMING_SNAKE_CASE_     :   Any=2 ,							SCREAMING_SNAKE_CASE_     :   List[Any]="absolute" ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=True ,							SCREAMING_SNAKE_CASE_     :   int=None ,							**SCREAMING_SNAKE_CASE_     :   Optional[int] ,							):
           super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_ ,							bos_token_id=SCREAMING_SNAKE_CASE_ ,							eos_token_id=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)

           lowerCAmelCase__      			=						vocab_size
           lowerCAmelCase__      			=						hidden_size
           lowerCAmelCase__      			=						num_hidden_layers
           lowerCAmelCase__      			=						num_attention_heads
           lowerCAmelCase__      			=						hidden_act
           lowerCAmelCase__      			=						intermediate_size
           lowerCAmelCase__      			=						hidden_dropout_prob
           lowerCAmelCase__      			=						attention_probs_dropout_prob
           lowerCAmelCase__      			=						max_position_embeddings
           lowerCAmelCase__      			=						type_vocab_size
           lowerCAmelCase__      			=						initializer_range
           lowerCAmelCase__      			=						layer_norm_eps
           lowerCAmelCase__      			=						position_embedding_type
           lowerCAmelCase__      			=						use_cache
           lowerCAmelCase__      			=						classifier_dropout



class  lowerCAmelCase_       (				snake_case__					):




       @property
       def 						__snake_case					(   self     :   List[str]	):
           if self.task == "multiple-choice":
               lowerCAmelCase__      			=						{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
           else:
               lowerCAmelCase__      			=						{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_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCAmelCase			:		List[str]   				=    {
    "configuration_electra": ["ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig", "ElectraOnnxConfig"],
    "tokenization_electra": ["ElectraTokenizer"],
}

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

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_UpperCAmelCase			:		Optional[Any]   				=    [
			    "ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "ElectraForCausalLM",
			    "ElectraForMaskedLM",
			    "ElectraForMultipleChoice",
			    "ElectraForPreTraining",
			    "ElectraForQuestionAnswering",
			    "ElectraForSequenceClassification",
			    "ElectraForTokenClassification",
			    "ElectraModel",
			    "ElectraPreTrainedModel",
			    "load_tf_weights_in_electra",
			]

try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_UpperCAmelCase			:		Union[str, Any]   				=    [
			    "TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "TFElectraForMaskedLM",
			    "TFElectraForMultipleChoice",
			    "TFElectraForPreTraining",
			    "TFElectraForQuestionAnswering",
			    "TFElectraForSequenceClassification",
			    "TFElectraForTokenClassification",
			    "TFElectraModel",
			    "TFElectraPreTrainedModel",
			]

try:
			if not is_flax_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_UpperCAmelCase			:		Optional[int]   				=    [
			    "FlaxElectraForCausalLM",
			    "FlaxElectraForMaskedLM",
			    "FlaxElectraForMultipleChoice",
			    "FlaxElectraForPreTraining",
			    "FlaxElectraForQuestionAnswering",
			    "FlaxElectraForSequenceClassification",
			    "FlaxElectraForTokenClassification",
			    "FlaxElectraModel",
			    "FlaxElectraPreTrainedModel",
			]


if TYPE_CHECKING:
			from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
			from .tokenization_electra import ElectraTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_electra_fast import ElectraTokenizerFast

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_electra import (
						    ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
						    ElectraForCausalLM,
						    ElectraForMaskedLM,
						    ElectraForMultipleChoice,
						    ElectraForPreTraining,
						    ElectraForQuestionAnswering,
						    ElectraForSequenceClassification,
						    ElectraForTokenClassification,
						    ElectraModel,
						    ElectraPreTrainedModel,
						    load_tf_weights_in_electra,
						)

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_electra import (
						    TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TFElectraForMaskedLM,
						    TFElectraForMultipleChoice,
						    TFElectraForPreTraining,
						    TFElectraForQuestionAnswering,
						    TFElectraForSequenceClassification,
						    TFElectraForTokenClassification,
						    TFElectraModel,
						    TFElectraPreTrainedModel,
						)

			try:
						if not is_flax_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_flax_electra import (
						    FlaxElectraForCausalLM,
						    FlaxElectraForMaskedLM,
						    FlaxElectraForMultipleChoice,
						    FlaxElectraForPreTraining,
						    FlaxElectraForQuestionAnswering,
						    FlaxElectraForSequenceClassification,
						    FlaxElectraForTokenClassification,
						    FlaxElectraModel,
						    FlaxElectraPreTrainedModel,
						)

else:
			import sys

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





