



import warnings

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


a_			=					logging.get_logger(__name__)

a_			=					{
    """xlnet-base-cased""": """https://huggingface.co/xlnet-base-cased/resolve/main/config.json""",
    """xlnet-large-cased""": """https://huggingface.co/xlnet-large-cased/resolve/main/config.json""",
}



class  __lowerCAmelCase     (	lowerCAmelCase__   ):
 lowerCAmelCase__       					=  """xlnet"""
 lowerCAmelCase__       					=  ["""mems"""]
 lowerCAmelCase__       					=  {
     """n_token""": """vocab_size""",  # Backward compatibility
     """hidden_size""": """d_model""",
     """num_attention_heads""": """n_head""",
     """num_hidden_layers""": """n_layer""",
 }




 def __init__(						self	,				__UpperCAmelCase=32000	,				__UpperCAmelCase=1024	,				__UpperCAmelCase=24	,				__UpperCAmelCase=16	,				__UpperCAmelCase=4096	,				__UpperCAmelCase="gelu"	,				__UpperCAmelCase=True	,				__UpperCAmelCase="bi"	,				__UpperCAmelCase=0.02	,				__UpperCAmelCase=1E-1_2	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=512	,				__UpperCAmelCase=None	,				__UpperCAmelCase=True	,				__UpperCAmelCase=False	,				__UpperCAmelCase=False	,				__UpperCAmelCase=-1	,				__UpperCAmelCase=False	,				__UpperCAmelCase="last"	,				__UpperCAmelCase=True	,				__UpperCAmelCase="tanh"	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=5	,				__UpperCAmelCase=5	,				__UpperCAmelCase=5	,				__UpperCAmelCase=1	,				__UpperCAmelCase=2	,				**__UpperCAmelCase	,				):



    '''simple docstring'''
    __lowerCamelCase													=    vocab_size
    __lowerCamelCase													=    d_model
    __lowerCamelCase													=    n_layer
    __lowerCamelCase													=    n_head
    if d_model % n_head != 0:
       raise ValueError(F"""'d_model % n_head' ({d_model % n_head}) should be equal to 0"""				)
    if "d_head" in kwargs:
       if kwargs["d_head"] != d_model // n_head:
          raise ValueError(
              F"""`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})"""				)
    __lowerCamelCase													=    d_model // n_head
    __lowerCamelCase													=    ff_activation
    __lowerCamelCase													=    d_inner
    __lowerCamelCase													=    untie_r
    __lowerCamelCase													=    attn_type

    __lowerCamelCase													=    initializer_range
    __lowerCamelCase													=    layer_norm_eps

    __lowerCamelCase													=    dropout
    __lowerCamelCase													=    mem_len
    __lowerCamelCase													=    reuse_len
    __lowerCamelCase													=    bi_data
    __lowerCamelCase													=    clamp_len
    __lowerCamelCase													=    same_length

    __lowerCamelCase													=    summary_type
    __lowerCamelCase													=    summary_use_proj
    __lowerCamelCase													=    summary_activation
    __lowerCamelCase													=    summary_last_dropout
    __lowerCamelCase													=    start_n_top
    __lowerCamelCase													=    end_n_top

    __lowerCamelCase													=    bos_token_id
    __lowerCamelCase													=    pad_token_id
    __lowerCamelCase													=    eos_token_id

    if "use_cache" in kwargs:
       warnings.warn(
           '''The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'''
           ''' instead.'''	,				_UpperCAmelCase	,				)
       __lowerCamelCase													=    kwargs['''use_cache''']

    __lowerCamelCase													=    use_mems_eval
    __lowerCamelCase													=    use_mems_train
    super().__init__(pad_token_id=_UpperCAmelCase	,				bos_token_id=_UpperCAmelCase	,				eos_token_id=_UpperCAmelCase	,				**_UpperCAmelCase				)




 @property
 def        lowerCamelCase      (						self				):



    '''simple docstring'''
    logger.info(F"""The model {self.model_type} is one of the few models that has no sequence length limit."""				)
    return -1




 @max_position_embeddings.setter
 def        lowerCamelCase      (						self	,				__UpperCAmelCase				):



    '''simple docstring'''
    raise NotImplementedError(
        F"""The model {self.model_type} is one of the few models that has no sequence length limit."""				)




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


a_			=					logging.get_logger(__name__)

a_			=					{
    """unc-nlp/lxmert-base-uncased""": """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json""",
}



class  __lowerCAmelCase     (	lowerCAmelCase__   ):
 lowerCAmelCase__       					=  """lxmert"""
 lowerCAmelCase__       					=  {}




 def __init__(						self	,				__UpperCAmelCase=30522	,				__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'''
    __lowerCamelCase													=    vocab_size
    __lowerCamelCase													=    hidden_size
    __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													=    num_qa_labels
    __lowerCamelCase													=    num_object_labels
    __lowerCamelCase													=    num_attr_labels
    __lowerCamelCase													=    l_layers
    __lowerCamelCase													=    x_layers
    __lowerCamelCase													=    r_layers
    __lowerCamelCase													=    visual_feat_dim
    __lowerCamelCase													=    visual_pos_dim
    __lowerCamelCase													=    visual_loss_normalizer
    __lowerCamelCase													=    task_matched
    __lowerCamelCase													=    task_mask_lm
    __lowerCamelCase													=    task_obj_predict
    __lowerCamelCase													=    task_qa
    __lowerCamelCase													=    visual_obj_loss
    __lowerCamelCase													=    visual_attr_loss
    __lowerCamelCase													=    visual_feat_loss
    __lowerCamelCase													=    {'''vision''': r_layers, '''cross_encoder''': x_layers, '''language''': l_layers}
    super().__init__(**__UpperCAmelCase				)






