




'''simple docstring'''




from typing import TYPE_CHECKING

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


a_ :						Any				 =			{
    '''configuration_roformer''': ['''ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RoFormerConfig''', '''RoFormerOnnxConfig'''],
    '''tokenization_roformer''': ['''RoFormerTokenizer'''],
}

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_ :						List[Any]				 =			['''RoFormerTokenizerFast''']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_ :						Optional[Any]				 =			[
         '''ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''RoFormerForCausalLM''',
         '''RoFormerForMaskedLM''',
         '''RoFormerForMultipleChoice''',
         '''RoFormerForQuestionAnswering''',
         '''RoFormerForSequenceClassification''',
         '''RoFormerForTokenClassification''',
         '''RoFormerLayer''',
         '''RoFormerModel''',
         '''RoFormerPreTrainedModel''',
         '''load_tf_weights_in_roformer''',
     ]


try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_ :						Dict				 =			[
         '''TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''TFRoFormerForCausalLM''',
         '''TFRoFormerForMaskedLM''',
         '''TFRoFormerForMultipleChoice''',
         '''TFRoFormerForQuestionAnswering''',
         '''TFRoFormerForSequenceClassification''',
         '''TFRoFormerForTokenClassification''',
         '''TFRoFormerLayer''',
         '''TFRoFormerModel''',
         '''TFRoFormerPreTrainedModel''',
     ]


try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_ :						Any				 =			[
         '''FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''FlaxRoFormerForMaskedLM''',
         '''FlaxRoFormerForMultipleChoice''',
         '''FlaxRoFormerForQuestionAnswering''',
         '''FlaxRoFormerForSequenceClassification''',
         '''FlaxRoFormerForTokenClassification''',
         '''FlaxRoFormerModel''',
         '''FlaxRoFormerPreTrainedModel''',
     ]


if TYPE_CHECKING:
     from .configuration_roformer import ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerOnnxConfig
     from .tokenization_roformer import RoFormerTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_roformer_fast import RoFormerTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_roformer import (
              ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              RoFormerForCausalLM,
              RoFormerForMaskedLM,
              RoFormerForMultipleChoice,
              RoFormerForQuestionAnswering,
              RoFormerForSequenceClassification,
              RoFormerForTokenClassification,
              RoFormerLayer,
              RoFormerModel,
              RoFormerPreTrainedModel,
              load_tf_weights_in_roformer,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_roformer import (
              TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFRoFormerForCausalLM,
              TFRoFormerForMaskedLM,
              TFRoFormerForMultipleChoice,
              TFRoFormerForQuestionAnswering,
              TFRoFormerForSequenceClassification,
              TFRoFormerForTokenClassification,
              TFRoFormerLayer,
              TFRoFormerModel,
              TFRoFormerPreTrainedModel,
          )

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_roformer import (
              FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              FlaxRoFormerForMaskedLM,
              FlaxRoFormerForMultipleChoice,
              FlaxRoFormerForQuestionAnswering,
              FlaxRoFormerForSequenceClassification,
              FlaxRoFormerForTokenClassification,
              FlaxRoFormerModel,
              FlaxRoFormerPreTrainedModel,
          )


else:
     import sys

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











'''simple docstring'''




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


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

lowercase__       : Optional[int]         =       {
    '''unc-nlp/lxmert-base-uncased''': '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json''',
}


class 					SCREAMING_SNAKE_CASE       (a__				):
     lowerCAmelCase						     =			'''lxmert'''
     lowerCAmelCase						     =			{}


     def __init__(		self		,      _UpperCAmelCase=3_0522		,      _UpperCAmelCase=768		,      _UpperCAmelCase=12		,      _UpperCAmelCase=9500		,      _UpperCAmelCase=1600		,      _UpperCAmelCase=400		,      _UpperCAmelCase=3072		,      _UpperCAmelCase="gelu"		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=512		,      _UpperCAmelCase=2		,      _UpperCAmelCase=0.02		,      _UpperCAmelCase=1e-1_2		,      _UpperCAmelCase=9		,      _UpperCAmelCase=5		,      _UpperCAmelCase=5		,      _UpperCAmelCase=2048		,      _UpperCAmelCase=4		,      _UpperCAmelCase=6.67		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      **_UpperCAmelCase		,      ):

          '''simple docstring'''






          __A		:					Tuple						=			vocab_size
          __A		:					int						=			hidden_size
          __A		:					str						=			num_attention_heads
          __A		:					Tuple						=			hidden_act
          __A		:					int						=			intermediate_size
          __A		:					str						=			hidden_dropout_prob
          __A		:					Optional[int]						=			attention_probs_dropout_prob
          __A		:					Optional[Any]						=			max_position_embeddings
          __A		:					Tuple						=			type_vocab_size
          __A		:					Optional[int]						=			initializer_range
          __A		:					Any						=			layer_norm_eps
          __A		:					Optional[Any]						=			num_qa_labels
          __A		:					Optional[int]						=			num_object_labels
          __A		:					Any						=			num_attr_labels
          __A		:					Union[str, Any]						=			l_layers
          __A		:					Optional[int]						=			x_layers
          __A		:					List[Any]						=			r_layers
          __A		:					Tuple						=			visual_feat_dim
          __A		:					Tuple						=			visual_pos_dim
          __A		:					Optional[int]						=			visual_loss_normalizer
          __A		:					int						=			task_matched
          __A		:					List[Any]						=			task_mask_lm
          __A		:					Optional[Any]						=			task_obj_predict
          __A		:					str						=			task_qa
          __A		:					List[Any]						=			visual_obj_loss
          __A		:					Optional[Any]						=			visual_attr_loss
          __A		:					Union[str, Any]						=			visual_feat_loss
          __A		:					Union[str, Any]						=			{'vision': r_layers, 'cross_encoder': x_layers, 'language': l_layers}
          super().__init__(**_UpperCAmelCase)