




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


A_      			=       logging.get_logger(__name__)

A_      			=       {
    '''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       lowercase(  __a				):







 '''simple docstring'''





 lowercase__				      =      "luke"


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




   '''simple docstring'''



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

   _snake_case							:	Optional[int]			=						vocab_size
   _snake_case							:	Any			=						entity_vocab_size
   _snake_case							:	Optional[Any]			=						hidden_size
   _snake_case							:	Union[str, Any]			=						entity_emb_size
   _snake_case							:	str			=						num_hidden_layers
   _snake_case							:	Union[str, Any]			=						num_attention_heads
   _snake_case							:	Any			=						hidden_act
   _snake_case							:	Union[str, Any]			=						intermediate_size
   _snake_case							:	str			=						hidden_dropout_prob
   _snake_case							:	Any			=						attention_probs_dropout_prob
   _snake_case							:	int			=						max_position_embeddings
   _snake_case							:	List[Any]			=						type_vocab_size
   _snake_case							:	List[str]			=						initializer_range
   _snake_case							:	Optional[Any]			=						layer_norm_eps
   _snake_case							:	Dict			=						use_entity_aware_attention
   _snake_case							:	List[Any]			=						classifier_dropout








"""simple docstring"""


from ...processing_utils import ProcessorMixin






class       lowercase(  __a				):







 '''simple docstring'''





 lowercase__				      =      ["image_processor", "feature_extractor"]
 lowercase__				      =      "TvltImageProcessor"
 lowercase__				      =      "TvltFeatureExtractor"


 def __init__(       self:	Dict,   a_:	Union[str, Any],   a_:	Union[str, Any]	):




   '''simple docstring'''



   super().__init__(image_processor=a_,   feature_extractor=a_	)

   _snake_case							:	Any			=						image_processor
   _snake_case							:	Dict			=						feature_extractor


 def __call__(       self:	int,   a_:	str=None,   a_:	Tuple=None,   a_:	Dict=None,   a_:	str=None,   a_:	Optional[int]=False,   a_:	Tuple=False,   *a_:	List[str],   **a_:	int,   ):




   '''simple docstring'''



   if images is None and audio is None:
     raise ValueError("""You need to specify either an `images` or `audio` input to process."""	)

   _snake_case							:	Optional[int]			=						None
   if images is not None:
     _snake_case							:	Tuple			=						self.image_processor(a_,   mask_pixel=a_,   *a_,   **a_	)
   if images_mixed is not None:
     _snake_case							:	Optional[int]			=						self.image_processor(a_,   is_mixed=a_,   *a_,   **a_	)
   if audio is not None:
     _snake_case							:	Any			=						self.feature_extractor(
         a_,   *a_,   sampling_rate=a_,   mask_audio=a_,   **a_	)

   _snake_case							:	List[str]			=						{}
   if audio is not None:
     output_dict.update(a_	)
   if images is not None:
     output_dict.update(a_	)
   if images_mixed_dict is not None:
     output_dict.update(a_	)
   return output_dict


 @property
 def 				UpperCamelCase_     (       self:	List[str]	):




   '''simple docstring'''



   _snake_case							:	Dict			=						self.image_processor.model_input_names
   _snake_case							:	List[str]			=						self.feature_extractor.model_input_names
   return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names	)	)


