'''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,
)


lowerCAmelCase_ : Tuple						  =      {
    "configuration_xlm_roberta": [
        "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "XLMRobertaConfig",
        "XLMRobertaOnnxConfig",
    ],
}

try:
       if not is_sentencepiece_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase_ : Optional[Any]						  =      ["XLMRobertaTokenizer"]

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase_ : str						  =      ["XLMRobertaTokenizerFast"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase_ : int						  =      [
           "XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "XLMRobertaForCausalLM",
           "XLMRobertaForMaskedLM",
           "XLMRobertaForMultipleChoice",
           "XLMRobertaForQuestionAnswering",
           "XLMRobertaForSequenceClassification",
           "XLMRobertaForTokenClassification",
           "XLMRobertaModel",
           "XLMRobertaPreTrainedModel",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase_ : int						  =      [
           "TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "TFXLMRobertaForCausalLM",
           "TFXLMRobertaForMaskedLM",
           "TFXLMRobertaForMultipleChoice",
           "TFXLMRobertaForQuestionAnswering",
           "TFXLMRobertaForSequenceClassification",
           "TFXLMRobertaForTokenClassification",
           "TFXLMRobertaModel",
           "TFXLMRobertaPreTrainedModel",
       ]

try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase_ : Tuple						  =      [
           "FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "FlaxXLMRobertaForMaskedLM",
           "FlaxXLMRobertaForCausalLM",
           "FlaxXLMRobertaForMultipleChoice",
           "FlaxXLMRobertaForQuestionAnswering",
           "FlaxXLMRobertaForSequenceClassification",
           "FlaxXLMRobertaForTokenClassification",
           "FlaxXLMRobertaModel",
           "FlaxXLMRobertaPreTrainedModel",
       ]

if TYPE_CHECKING:
       from .configuration_xlm_roberta import (
           XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP,
           XLMRobertaConfig,
           XLMRobertaOnnxConfig,
       )

       try:
              if not is_sentencepiece_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_xlm_roberta import XLMRobertaTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_xlm_roberta_fast import XLMRobertaTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_xlm_roberta import (
                  XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XLMRobertaForCausalLM,
                  XLMRobertaForMaskedLM,
                  XLMRobertaForMultipleChoice,
                  XLMRobertaForQuestionAnswering,
                  XLMRobertaForSequenceClassification,
                  XLMRobertaForTokenClassification,
                  XLMRobertaModel,
                  XLMRobertaPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_xlm_roberta import (
                  TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFXLMRobertaForCausalLM,
                  TFXLMRobertaForMaskedLM,
                  TFXLMRobertaForMultipleChoice,
                  TFXLMRobertaForQuestionAnswering,
                  TFXLMRobertaForSequenceClassification,
                  TFXLMRobertaForTokenClassification,
                  TFXLMRobertaModel,
                  TFXLMRobertaPreTrainedModel,
              )

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_xlm_roberta import (
                  FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FlaxXLMRobertaForCausalLM,
                  FlaxXLMRobertaForMaskedLM,
                  FlaxXLMRobertaForMultipleChoice,
                  FlaxXLMRobertaForQuestionAnswering,
                  FlaxXLMRobertaForSequenceClassification,
                  FlaxXLMRobertaForTokenClassification,
                  FlaxXLMRobertaModel,
                  FlaxXLMRobertaPreTrainedModel,
              )

else:
       import sys

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







'''simple docstring'''

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


lowerCAmelCase_ : Dict						  =      logging.get_logger(__name__)

lowerCAmelCase_ : List[Any]						  =      {
    "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json",
}





class 							lowercase						(						__lowerCamelCase ):
   lowerCamelCase_    					='lxmert'
   lowerCamelCase_    					={}


   def __init__(   self				:	str   ,		__lowerCAmelCase				:	str=3_0522   ,		__lowerCAmelCase				:	Dict=768   ,		__lowerCAmelCase				:	List[str]=12   ,		__lowerCAmelCase				:	List[str]=9500   ,		__lowerCAmelCase				:	Optional[int]=1600   ,		__lowerCAmelCase				:	Tuple=400   ,		__lowerCAmelCase				:	str=3072   ,		__lowerCAmelCase				:	str="gelu"   ,		__lowerCAmelCase				:	Optional[Any]=0.1   ,		__lowerCAmelCase				:	List[Any]=0.1   ,		__lowerCAmelCase				:	Tuple=512   ,		__lowerCAmelCase				:	Tuple=2   ,		__lowerCAmelCase				:	Dict=0.02   ,		__lowerCAmelCase				:	int=1e-12   ,		__lowerCAmelCase				:	Union[str, Any]=9   ,		__lowerCAmelCase				:	List[str]=5   ,		__lowerCAmelCase				:	Any=5   ,		__lowerCAmelCase				:	Dict=2048   ,		__lowerCAmelCase				:	Any=4   ,		__lowerCAmelCase				:	Optional[int]=6.67   ,		__lowerCAmelCase				:	Optional[Any]=True   ,		__lowerCAmelCase				:	Tuple=True   ,		__lowerCAmelCase				:	Optional[int]=True   ,		__lowerCAmelCase				:	List[Any]=True   ,		__lowerCAmelCase				:	Optional[Any]=True   ,		__lowerCAmelCase				:	int=True   ,		__lowerCAmelCase				:	List[str]=True   ,		**__lowerCAmelCase				:	Dict   ,		)      ->					Dict:
         lowercase_     =      vocab_size
         lowercase_     =      hidden_size
         lowercase_     =      num_attention_heads
         lowercase_     =      hidden_act
         lowercase_     =      intermediate_size
         lowercase_     =      hidden_dropout_prob
         lowercase_     =      attention_probs_dropout_prob
         lowercase_     =      max_position_embeddings
         lowercase_     =      type_vocab_size
         lowercase_     =      initializer_range
         lowercase_     =      layer_norm_eps
         lowercase_     =      num_qa_labels
         lowercase_     =      num_object_labels
         lowercase_     =      num_attr_labels
         lowercase_     =      l_layers
         lowercase_     =      x_layers
         lowercase_     =      r_layers
         lowercase_     =      visual_feat_dim
         lowercase_     =      visual_pos_dim
         lowercase_     =      visual_loss_normalizer
         lowercase_     =      task_matched
         lowercase_     =      task_mask_lm
         lowercase_     =      task_obj_predict
         lowercase_     =      task_qa
         lowercase_     =      visual_obj_loss
         lowercase_     =      visual_attr_loss
         lowercase_     =      visual_feat_loss
         lowercase_     =      {"vision": r_layers, "cross_encoder": x_layers, "language": l_layers}
         super().__init__(**__lowerCAmelCase)






