





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

class SCREAMING_SNAKE_CASE_ (					lowercase_   ):





					"""simple docstring"""


					A__				 =    ["image_processor", "tokenizer"]
					A__				 =    "AutoImageProcessor"
					A__				 =    "AutoTokenizer"





					def __init__( self	,  _lowerCAmelCase	,  _lowerCAmelCase	):
										super().__init__(_lowerCAmelCase	,  _lowerCAmelCase	)
										lowerCamelCase__       =       self.image_processor





					def __call__( self	,  _lowerCAmelCase=None	,  _lowerCAmelCase=None	,  _lowerCAmelCase=None	,  **_lowerCAmelCase	):

										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:
															lowerCamelCase__       =       self.tokenizer(_lowerCAmelCase	,  return_tensors=_lowerCAmelCase	,  **_lowerCAmelCase	)

										if images is not None:
															lowerCamelCase__       =       self.image_processor(_lowerCAmelCase	,  return_tensors=_lowerCAmelCase	,  **_lowerCAmelCase	)

										if text is not None and images is not None:
															lowerCamelCase__       =       image_features.pixel_values
															return encoding
										elif text is not None:
															return encoding
										else:
															return BatchEncoding(data=dict(**_lowerCAmelCase	)	,  tensor_type=_lowerCAmelCase	)





					def 					__magic_name__ ( self	,  *_lowerCAmelCase	,  **_lowerCAmelCase	):
										return self.tokenizer.batch_decode(*_lowerCAmelCase	,  **_lowerCAmelCase	)





					def 					__magic_name__ ( self	,  *_lowerCAmelCase	,  **_lowerCAmelCase	):
										return self.tokenizer.decode(*_lowerCAmelCase	,  **_lowerCAmelCase	)






					@property
					def 					__magic_name__ ( self	):
										return ["input_ids", "attention_mask", "pixel_values"]








from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig


A_												=     {
    "albert-base-v1": "https://huggingface.co/albert-base-v1/resolve/main/config.json",
    "albert-large-v1": "https://huggingface.co/albert-large-v1/resolve/main/config.json",
    "albert-xlarge-v1": "https://huggingface.co/albert-xlarge-v1/resolve/main/config.json",
    "albert-xxlarge-v1": "https://huggingface.co/albert-xxlarge-v1/resolve/main/config.json",
    "albert-base-v2": "https://huggingface.co/albert-base-v2/resolve/main/config.json",
    "albert-large-v2": "https://huggingface.co/albert-large-v2/resolve/main/config.json",
    "albert-xlarge-v2": "https://huggingface.co/albert-xlarge-v2/resolve/main/config.json",
    "albert-xxlarge-v2": "https://huggingface.co/albert-xxlarge-v2/resolve/main/config.json",
}

class SCREAMING_SNAKE_CASE_ (					lowercase_   ):





					"""simple docstring"""


					A__				 =    "albert"





					def __init__( self	,  _lowerCAmelCase=3_0000	,  _lowerCAmelCase=128	,  _lowerCAmelCase=4096	,  _lowerCAmelCase=12	,  _lowerCAmelCase=1	,  _lowerCAmelCase=64	,  _lowerCAmelCase=1_6384	,  _lowerCAmelCase=1	,  _lowerCAmelCase="gelu_new"	,  _lowerCAmelCase=0	,  _lowerCAmelCase=0	,  _lowerCAmelCase=512	,  _lowerCAmelCase=2	,  _lowerCAmelCase=0.02	,  _lowerCAmelCase=1E-12	,  _lowerCAmelCase=0.1	,  _lowerCAmelCase="absolute"	,  _lowerCAmelCase=0	,  _lowerCAmelCase=2	,  _lowerCAmelCase=3	,  **_lowerCAmelCase	,  ):
										super().__init__(pad_token_id=_lowerCAmelCase	,  bos_token_id=_lowerCAmelCase	,  eos_token_id=_lowerCAmelCase	,  **_lowerCAmelCase	)

										lowerCamelCase__       =       vocab_size
										lowerCamelCase__       =       embedding_size
										lowerCamelCase__       =       hidden_size
										lowerCamelCase__       =       num_hidden_layers
										lowerCamelCase__       =       num_hidden_groups
										lowerCamelCase__       =       num_attention_heads
										lowerCamelCase__       =       inner_group_num
										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__       =       classifier_dropout_prob
										lowerCamelCase__       =       position_embedding_type

class SCREAMING_SNAKE_CASE_ (					lowercase_   ):





					"""simple docstring"""


					@property
					def 					__magic_name__ ( self	):
										if self.task == "multiple-choice":
															lowerCamelCase__       =       {0: "batch", 1: "choice", 2: "sequence"}
										else:
															lowerCamelCase__       =       {0: "batch", 1: "sequence"}
										return OrderedDict(
										    [
										        ("input_ids", dynamic_axis),
										        ("attention_mask", dynamic_axis),
										        ("token_type_ids", dynamic_axis),
										    ]	)

