




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


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

_lowerCamelCase	:		Optional[int]							       =   {
    """studio-ousia/luke-base""": """https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json""",
    """studio-ousia/luke-large""": """https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json""",
}


class 				UpperCamelCase_    ( UpperCAmelCase__     ):

    '''simple docstring'''






    UpperCAmelCase__							  =      '''luke'''


    def __init__(			self      :	Any					, UpperCAmelCase__      :	str=50_267					, UpperCAmelCase__      :	Any=500_000					, UpperCAmelCase__      :	Dict=768					, UpperCAmelCase__      :	str=256					, UpperCAmelCase__      :	Dict=12					, UpperCAmelCase__      :	List[str]=12					, UpperCAmelCase__      :	Optional[Any]=3_072					, UpperCAmelCase__      :	Union[str, Any]="gelu"					, UpperCAmelCase__      :	Union[str, Any]=0.1					, UpperCAmelCase__      :	List[Any]=0.1					, UpperCAmelCase__      :	Optional[int]=512					, UpperCAmelCase__      :	Tuple=2					, UpperCAmelCase__      :	str=0.02					, UpperCAmelCase__      :	Optional[Any]=1e-12					, UpperCAmelCase__      :	List[str]=True					, UpperCAmelCase__      :	Optional[Any]=None					, UpperCAmelCase__      :	str=1					, UpperCAmelCase__      :	Union[str, Any]=0					, UpperCAmelCase__      :	Optional[int]=2					, **UpperCAmelCase__      :	Any					, )						->List[Any]:





           '''simple docstring'''

           super().__init__(pad_token_id=UpperCAmelCase__					, bos_token_id=UpperCAmelCase__					, eos_token_id=UpperCAmelCase__					, **UpperCAmelCase__)

           A__       =    vocab_size
           A__       =    entity_vocab_size
           A__       =    hidden_size
           A__       =    entity_emb_size
           A__       =    num_hidden_layers
           A__       =    num_attention_heads
           A__       =    hidden_act
           A__       =    intermediate_size
           A__       =    hidden_dropout_prob
           A__       =    attention_probs_dropout_prob
           A__       =    max_position_embeddings
           A__       =    type_vocab_size
           A__       =    initializer_range
           A__       =    layer_norm_eps
           A__       =    use_entity_aware_attention
           A__       =    classifier_dropout








import copy

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


_lowerCamelCase	:		Any							       =   logging.get_logger(__name__)


class 				UpperCamelCase_    ( UpperCAmelCase__     ):

    '''simple docstring'''






    UpperCAmelCase__							  =      '''encoder-decoder'''
    UpperCAmelCase__							  =      True


    def __init__(			self      :	List[str]					, **UpperCAmelCase__      :	Union[str, Any])						->List[Any]:





           '''simple docstring'''

           super().__init__(**UpperCAmelCase__)
           assert (
               "encoder" in kwargs and "decoder" in kwargs
           ), "Config has to be initialized with encoder and decoder config"
           A__       =    kwargs.pop('''encoder''')
           A__       =    encoder_config.pop('''model_type''')
           A__       =    kwargs.pop('''decoder''')
           A__       =    decoder_config.pop('''model_type''')

           from ..auto.configuration_auto import AutoConfig

           A__       =    AutoConfig.for_model(UpperCAmelCase__					, **UpperCAmelCase__)
           A__       =    AutoConfig.for_model(UpperCAmelCase__					, **UpperCAmelCase__)
           A__       =    True


    @classmethod
    def        SCREAMING_SNAKE_CASE							(			cls      :	Union[str, Any]					, UpperCAmelCase__      :	PretrainedConfig					, UpperCAmelCase__      :	PretrainedConfig					, **UpperCAmelCase__      :	Union[str, Any])						->PretrainedConfig:





           '''simple docstring'''

           logger.info('''Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config''')
           A__       =    True
           A__       =    True

           return cls(encoder=encoder_config.to_dict()					, decoder=decoder_config.to_dict()					, **UpperCAmelCase__)





    def        SCREAMING_SNAKE_CASE							(			self      :	str)						->Optional[Any]:





           '''simple docstring'''

           A__       =    copy.deepcopy(self.__dict__)
           A__       =    self.encoder.to_dict()
           A__       =    self.decoder.to_dict()
           A__       =    self.__class__.model_type
           return output


