




'''simple docstring'''





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


a		:	Any       =      logging.get_logger(__name__)

a		:	Dict       =      {
    'bert-base-uncased': 'https://huggingface.co/bert-base-uncased/resolve/main/config.json',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}




class      UpperCamelCase       (	snake_case__       ):
  a     :Optional[Any]          =					'''qdqbert'''



  def __init__(			self		,     __lowerCAmelCase=3_0522		,     __lowerCAmelCase=768		,     __lowerCAmelCase=12		,     __lowerCAmelCase=12		,     __lowerCAmelCase=3072		,     __lowerCAmelCase="gelu"		,     __lowerCAmelCase=0.1		,     __lowerCAmelCase=0.1		,     __lowerCAmelCase=512		,     __lowerCAmelCase=2		,     __lowerCAmelCase=0.02		,     __lowerCAmelCase=1e-12		,     __lowerCAmelCase=True		,     __lowerCAmelCase=1		,     __lowerCAmelCase=0		,     __lowerCAmelCase=2		,     **__lowerCAmelCase		,     ):







      '''simple docstring'''


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

      _a				:							Any							       =      vocab_size
      _a				:							Optional[Any]							       =      max_position_embeddings
      _a				:							Optional[Any]							       =      hidden_size
      _a				:							Any							       =      num_hidden_layers
      _a				:							List[str]							       =      num_attention_heads
      _a				:							Optional[Any]							       =      intermediate_size
      _a				:							str							       =      hidden_act
      _a				:							Optional[Any]							       =      hidden_dropout_prob
      _a				:							int							       =      attention_probs_dropout_prob
      _a				:							List[str]							       =      initializer_range
      _a				:							Any							       =      type_vocab_size
      _a				:							str							       =      layer_norm_eps
      _a				:							List[str]							       =      use_cache




from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding





class 		__lowerCamelCase     (   lowercase		):
							lowerCamelCase__:				Any      =							['''image_processor''', '''tokenizer''']
							lowerCamelCase__:				List[Any]      =							'''EfficientNetImageProcessor'''
							lowerCamelCase__:				str      =							('''BertTokenizer''', '''BertTokenizerFast''')



							def __init__(     self	,				__snake_case	,				__snake_case							)						->     Optional[Any]:






								"""simple docstring"""



								super().__init__(__snake_case	,				__snake_case							)



							def __call__(     self	,				__snake_case=None	,				__snake_case=None	,				__snake_case="max_length"	,				__snake_case=6_4	,				__snake_case=None	,				**__snake_case							)						->     Any:






								"""simple docstring"""



								if text is None and images is None:
									raise ValueError("You have to specify either text or images. Both cannot be none."							)

								if text is not None:
									UpperCAmelCase:					Dict 						=     self.tokenizer(
									    __snake_case	,				padding=__snake_case	,				max_length=__snake_case	,				return_tensors=__snake_case	,				**__snake_case							)

								if images is not None:
									UpperCAmelCase:					List[str] 						=     self.image_processor(__snake_case	,				return_tensors=__snake_case	,				**__snake_case							)

								if text is not None and images is not None:
									UpperCAmelCase:					Optional[int] 						=     image_features.pixel_values
									return encoding
								elif text is not None:
									return encoding
								else:
									return BatchEncoding(data=dict(**__snake_case							)	,				tensor_type=__snake_case							)



							def     A__ (     self	,				*__snake_case	,				**__snake_case							)						->     Any:






								"""simple docstring"""



								return self.tokenizer.batch_decode(*__snake_case	,				**__snake_case							)



							def     A__ (     self	,				*__snake_case	,				**__snake_case							)						->     List[str]:






								"""simple docstring"""



								return self.tokenizer.decode(*__snake_case	,				**__snake_case							)




							@property
							def     A__ (     self							)						->     Optional[int]:






								"""simple docstring"""



								UpperCAmelCase:					Optional[int] 						=     self.tokenizer.model_input_names
								UpperCAmelCase:					int 						=     self.image_processor.model_input_names
								return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names							)							)
