


'''simple docstring'''
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

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


if TYPE_CHECKING:
							from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType


__SCREAMING_SNAKE_CASE					:				List[str]									=		logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE					:				Union[str, Any]									=		{
    '''microsoft/deberta-v2-xlarge''': '''https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json''',
    '''microsoft/deberta-v2-xxlarge''': '''https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json''',
    '''microsoft/deberta-v2-xlarge-mnli''': (
        '''https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json'''
    ),
    '''microsoft/deberta-v2-xxlarge-mnli''': (
        '''https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json'''
    ),
}






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       int   						="deberta-v2"






						def __init__(  self							:      Any ,  lowerCAmelCase							:      Dict=12_81_00 ,  lowerCAmelCase							:      Any=15_36 ,  lowerCAmelCase							:      List[Any]=24 ,  lowerCAmelCase							:      Union[str, Any]=24 ,  lowerCAmelCase							:      str=61_44 ,  lowerCAmelCase							:      Optional[Any]="gelu" ,  lowerCAmelCase							:      Tuple=0.1 ,  lowerCAmelCase							:      int=0.1 ,  lowerCAmelCase							:      List[str]=5_12 ,  lowerCAmelCase							:      List[Any]=0 ,  lowerCAmelCase							:      int=0.0_2 ,  lowerCAmelCase							:      int=1e-7 ,  lowerCAmelCase							:      Optional[Any]=False ,  lowerCAmelCase							:      Union[str, Any]=-1 ,  lowerCAmelCase							:      Dict=0 ,  lowerCAmelCase							:      Dict=True ,  lowerCAmelCase							:      int=None ,  lowerCAmelCase							:      List[Any]=0 ,  lowerCAmelCase							:      Optional[int]="gelu" ,  **lowerCAmelCase							:      Dict ,  ):
													super().__init__(**lowerCAmelCase	)

													A_			    =		hidden_size
													A_			    =		num_hidden_layers
													A_			    =		num_attention_heads
													A_			    =		intermediate_size
													A_			    =		hidden_act
													A_			    =		hidden_dropout_prob
													A_			    =		attention_probs_dropout_prob
													A_			    =		max_position_embeddings
													A_			    =		type_vocab_size
													A_			    =		initializer_range
													A_			    =		relative_attention
													A_			    =		max_relative_positions
													A_			    =		pad_token_id
													A_			    =		position_biased_input

													# Backwards compatibility
													if type(lowerCAmelCase	) == str:
																				A_			    =		[x.strip() for x in pos_att_type.lower().split("|"	)]

													A_			    =		pos_att_type
													A_			    =		vocab_size
													A_			    =		layer_norm_eps

													A_			    =		kwargs.get("pooler_hidden_size" ,  lowerCAmelCase	)
													A_			    =		pooler_dropout
													A_			    =		pooler_hidden_act






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






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






						@property
						def 				_UpperCAmelCase       (  self							:      str	):
													return 12






						def 				_UpperCAmelCase       (  self							:      int ,  lowerCAmelCase							:      Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"] ,  lowerCAmelCase							:      int = -1 ,  lowerCAmelCase							:      int = -1 ,  lowerCAmelCase							:      int = -1 ,  lowerCAmelCase							:      bool = False ,  lowerCAmelCase							:      Optional["TensorType"] = None ,  lowerCAmelCase							:      int = 3 ,  lowerCAmelCase							:      int = 40 ,  lowerCAmelCase							:      int = 40 ,  lowerCAmelCase							:      "PreTrainedTokenizerBase" = None ,  ):
													A_			    =		super().generate_dummy_inputs(preprocessor=lowerCAmelCase ,  framework=lowerCAmelCase	)
													if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
																				del dummy_inputs["token_type_ids"]
													return dummy_inputs









'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__SCREAMING_SNAKE_CASE					:				Optional[int]									=		logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE					:				Union[str, Any]									=		{
    '''tanreinama/GPTSAN-2.8B-spout_is_uniform''': (
        '''https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json'''
    ),
}






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       Optional[int]   						="gptsan-japanese"
						_UpperCAmelCase		:       Union[str, Any]   						=[
						    "past_key_values",
						]
						_UpperCAmelCase		:       int   						={
						    "hidden_size": "d_model",
						    "num_attention_heads": "num_heads",
						    "num_hidden_layers": "num_layers",
						}






						def __init__(  self							:      List[str] ,  lowerCAmelCase							:      Dict=3_60_00 ,  lowerCAmelCase							:      Union[str, Any]=12_80 ,  lowerCAmelCase							:      Tuple=10_24 ,  lowerCAmelCase							:      Any=81_92 ,  lowerCAmelCase							:      List[str]=40_96 ,  lowerCAmelCase							:      Dict=1_28 ,  lowerCAmelCase							:      int=10 ,  lowerCAmelCase							:      str=0 ,  lowerCAmelCase							:      int=16 ,  lowerCAmelCase							:      int=16 ,  lowerCAmelCase							:      str=1_28 ,  lowerCAmelCase							:      Dict=0.0 ,  lowerCAmelCase							:      List[str]=1e-5 ,  lowerCAmelCase							:      List[str]=False ,  lowerCAmelCase							:      int=0.0 ,  lowerCAmelCase							:      Tuple="float32" ,  lowerCAmelCase							:      Optional[int]=False ,  lowerCAmelCase							:      int=False ,  lowerCAmelCase							:      Tuple=False ,  lowerCAmelCase							:      Optional[Any]=0.0_0_2 ,  lowerCAmelCase							:      Tuple=False ,  lowerCAmelCase							:      str=True ,  lowerCAmelCase							:      Optional[int]=3_59_98 ,  lowerCAmelCase							:      Optional[Any]=3_59_95 ,  lowerCAmelCase							:      Tuple=3_59_99 ,  **lowerCAmelCase							:      Dict ,  ):
													A_			    =		vocab_size
													A_			    =		max_position_embeddings
													A_			    =		d_model
													A_			    =		d_ff
													A_			    =		d_ext
													A_			    =		d_spout
													A_			    =		num_switch_layers
													A_			    =		num_ext_layers
													A_			    =		num_switch_layers + num_ext_layers
													A_			    =		num_heads
													A_			    =		num_experts
													A_			    =		expert_capacity
													A_			    =		dropout_rate
													A_			    =		layer_norm_epsilon
													A_			    =		router_bias
													A_			    =		router_jitter_noise
													A_			    =		router_dtype
													A_			    =		router_ignore_padding_tokens
													A_			    =		output_hidden_states
													A_			    =		output_attentions
													A_			    =		initializer_factor
													A_			    =		output_router_logits
													A_			    =		use_cache

													super().__init__(
													    separator_token_id=lowerCAmelCase ,  pad_token_id=lowerCAmelCase ,  eos_token_id=lowerCAmelCase ,  **lowerCAmelCase ,  )





