






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase     :   Optional[int]	      =		{
    'configuration_blenderbot': [
        'BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BlenderbotConfig',
        'BlenderbotOnnxConfig',
    ],
    'tokenization_blenderbot': ['BlenderbotTokenizer'],
}

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase     :   Tuple	      =		['BlenderbotTokenizerFast']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase     :   List[str]	      =		[
							    'BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'BlenderbotForCausalLM',
							    'BlenderbotForConditionalGeneration',
							    'BlenderbotModel',
							    'BlenderbotPreTrainedModel',
							]


try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase     :   Tuple	      =		[
							    'TFBlenderbotForConditionalGeneration',
							    'TFBlenderbotModel',
							    'TFBlenderbotPreTrainedModel',
							]


try:
							if not is_flax_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase     :   Optional[int]	      =		[
							    'FlaxBlenderbotForConditionalGeneration',
							    'FlaxBlenderbotModel',
							    'FlaxBlenderbotPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_blenderbot import (
							    BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    BlenderbotConfig,
							    BlenderbotOnnxConfig,
							)
							from .tokenization_blenderbot import BlenderbotTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_blenderbot_fast import BlenderbotTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_blenderbot import (
														    BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    BlenderbotForCausalLM,
														    BlenderbotForConditionalGeneration,
														    BlenderbotModel,
														    BlenderbotPreTrainedModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_blenderbot import (
														    TFBlenderbotForConditionalGeneration,
														    TFBlenderbotModel,
														    TFBlenderbotPreTrainedModel,
														)

							try:
														if not is_flax_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_flax_blenderbot import (
														    FlaxBlenderbotForConditionalGeneration,
														    FlaxBlenderbotModel,
														    FlaxBlenderbotPreTrainedModel,
														)

else:
							import sys

							UpperCamelCase     :   Any	      =		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






from collections import OrderedDict
from typing import Mapping

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


lowercase_													=      logging.get_logger(__name__)

lowercase_													=      {
    '''distilbert-base-uncased''': '''https://huggingface.co/distilbert-base-uncased/resolve/main/config.json''',
    '''distilbert-base-uncased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-cased''': '''https://huggingface.co/distilbert-base-cased/resolve/main/config.json''',
    '''distilbert-base-cased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-german-cased''': '''https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json''',
    '''distilbert-base-multilingual-cased''': (
        '''https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json'''
    ),
    '''distilbert-base-uncased-finetuned-sst-2-english''': (
        '''https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json'''
    ),
}






class     __a			(  SCREAMING_SNAKE_CASE					):
	SCREAMING_SNAKE_CASE  	=							"distilbert"
	SCREAMING_SNAKE_CASE  	=							{
	    "hidden_size": "dim",
	    "num_attention_heads": "n_heads",
	    "num_hidden_layers": "n_layers",
	}



	def __init__(    self				:     Optional[Any]					,						snake_case_				:     Tuple=3_05_22					,						snake_case_				:     Any=5_12					,						snake_case_				:     Dict=False					,						snake_case_				:     Tuple=6					,						snake_case_				:     Union[str, Any]=12					,						snake_case_				:     List[str]=7_68					,						snake_case_				:     Optional[Any]=4 * 7_68					,						snake_case_				:     Optional[Any]=0.1					,						snake_case_				:     Dict=0.1					,						snake_case_				:     Union[str, Any]="gelu"					,						snake_case_				:     Any=0.0_2					,						snake_case_				:     Optional[Any]=0.1					,						snake_case_				:     List[Any]=0.2					,						snake_case_				:     Optional[Any]=0					,						**snake_case_				:     List[Any]					,						)->				Tuple:
						__lowerCAmelCase						 =vocab_size
						__lowerCAmelCase						 =max_position_embeddings
						__lowerCAmelCase						 =sinusoidal_pos_embds
						__lowerCAmelCase						 =n_layers
						__lowerCAmelCase						 =n_heads
						__lowerCAmelCase						 =dim
						__lowerCAmelCase						 =hidden_dim
						__lowerCAmelCase						 =dropout
						__lowerCAmelCase						 =attention_dropout
						__lowerCAmelCase						 =activation
						__lowerCAmelCase						 =initializer_range
						__lowerCAmelCase						 =qa_dropout
						__lowerCAmelCase						 =seq_classif_dropout
						super().__init__(**snake_case_					,						pad_token_id=snake_case_)






class     __a			(  SCREAMING_SNAKE_CASE					):



	@property
	def 		UpperCamelCase				(    self				:     Union[str, 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),
						    ])




