
from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


SCREAMING_SNAKE_CASE__     :    int      							=					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__     :    Tuple      							=					{
    "google/electra-small-generator": "https://huggingface.co/google/electra-small-generator/resolve/main/config.json",
    "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/config.json",
    "google/electra-large-generator": "https://huggingface.co/google/electra-large-generator/resolve/main/config.json",
    "google/electra-small-discriminator": (
        "https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json"
    ),
    "google/electra-base-discriminator": (
        "https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json"
    ),
    "google/electra-large-discriminator": (
        "https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json"
    ),
}

class      lowerCAmelCase__  (			__lowercase    ):
		a__ :		str   						=	"""electra"""






		def __init__(	self	:							int							,    SCREAMING_SNAKE_CASE__	:							Optional[Any]=3_05_22							,    SCREAMING_SNAKE_CASE__	:							List[str]=1_28							,    SCREAMING_SNAKE_CASE__	:							Tuple=2_56							,    SCREAMING_SNAKE_CASE__	:							Optional[int]=12							,    SCREAMING_SNAKE_CASE__	:							str=4							,    SCREAMING_SNAKE_CASE__	:							Optional[Any]=10_24							,    SCREAMING_SNAKE_CASE__	:							List[str]="gelu"							,    SCREAMING_SNAKE_CASE__	:							List[str]=0.1							,    SCREAMING_SNAKE_CASE__	:							Any=0.1							,    SCREAMING_SNAKE_CASE__	:							List[str]=5_12							,    SCREAMING_SNAKE_CASE__	:							str=2							,    SCREAMING_SNAKE_CASE__	:							Tuple=0.02							,    SCREAMING_SNAKE_CASE__	:							Union[str, Any]=1e-12							,    SCREAMING_SNAKE_CASE__	:							Any="first"							,    SCREAMING_SNAKE_CASE__	:							str=True							,    SCREAMING_SNAKE_CASE__	:							Dict="gelu"							,    SCREAMING_SNAKE_CASE__	:							List[Any]=0.1							,    SCREAMING_SNAKE_CASE__	:							str=0							,    SCREAMING_SNAKE_CASE__	:							List[Any]="absolute"							,    SCREAMING_SNAKE_CASE__	:							Union[str, Any]=True							,    SCREAMING_SNAKE_CASE__	:							List[str]=None							,    **SCREAMING_SNAKE_CASE__	:							List[Any]							,    )  ->							int:
						super().__init__(pad_token_id=SCREAMING_SNAKE_CASE__							,    **SCREAMING_SNAKE_CASE__						)

						__lowerCamelCase					      =			vocab_size
						__lowerCamelCase					      =			embedding_size
						__lowerCamelCase					      =			hidden_size
						__lowerCamelCase					      =			num_hidden_layers
						__lowerCamelCase					      =			num_attention_heads
						__lowerCamelCase					      =			intermediate_size
						__lowerCamelCase					      =			hidden_act
						__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					      =			summary_type
						__lowerCamelCase					      =			summary_use_proj
						__lowerCamelCase					      =			summary_activation
						__lowerCamelCase					      =			summary_last_dropout
						__lowerCamelCase					      =			position_embedding_type
						__lowerCamelCase					      =			use_cache
						__lowerCamelCase					      =			classifier_dropout





class      lowerCAmelCase__  (			__lowercase    ):






		@property
		def 				__A (	self	:							Any						)  ->							Mapping[str, Mapping[int, str]]:
						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),
						    ]						)




def 				__magic_name__				(     __lowerCAmelCase			:		list	,						__lowerCAmelCase			:		int	,						__lowerCAmelCase			:		int	,						__lowerCAmelCase			:		int							)    ->     int:
				__lowerCamelCase					      =			int((lower_bound + upper_bound) // 2							)
				if array[r] == value:
								return r
				if lower_bound >= upper_bound:
								return -1
				if array[r] < value:
								return binary_search(__lowerCAmelCase	,						r + 1	,						__lowerCAmelCase	,						__lowerCAmelCase							)
				else:
								return binary_search(__lowerCAmelCase	,						__lowerCAmelCase	,						r - 1	,						__lowerCAmelCase							)




def 				__magic_name__				(     __lowerCAmelCase			:		int	,						__lowerCAmelCase			:		list							)    ->     list:
				__lowerCamelCase					      =			0
				if matrix[index][0] == value:
								return [index, 0]
				while index < len(__lowerCAmelCase							) and matrix[index][0] < value:
								__lowerCamelCase					      =			binary_search(matrix[index]	,						0	,						len(matrix[index]							) - 1	,						__lowerCAmelCase							)
								if r != -1:
												return [index, r]
								index += 1
				return [-1, -1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()



