






from collections import OrderedDict
from typing import Mapping

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


__UpperCAmelCase							:   Union[str, Any]							=  logging.get_logger(__name__)

__UpperCAmelCase							:   Any							=  {
    "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 					_snake_case						(			_A ):
	_A          =   'distilbert'
	_A          =   {
	    'hidden_size': 'dim',
	    'num_attention_heads': 'n_heads',
	    'num_hidden_layers': 'n_layers',
	}






	def __init__(		self					,UpperCamelCase=30_522					,UpperCamelCase=512					,UpperCamelCase=False					,UpperCamelCase=6					,UpperCamelCase=12					,UpperCamelCase=768					,UpperCamelCase=4 * 768					,UpperCamelCase=0.1					,UpperCamelCase=0.1					,UpperCamelCase="gelu"					,UpperCamelCase=0.02					,UpperCamelCase=0.1					,UpperCamelCase=0.2					,UpperCamelCase=0					,**UpperCamelCase					,)						->    List[Any]:
					snake_case__      :str         =   vocab_size
					snake_case__      :Union[str, Any]         =   max_position_embeddings
					snake_case__      :List[str]         =   sinusoidal_pos_embds
					snake_case__      :Tuple         =   n_layers
					snake_case__      :Optional[Any]         =   n_heads
					snake_case__      :Dict         =   dim
					snake_case__      :List[str]         =   hidden_dim
					snake_case__      :str         =   dropout
					snake_case__      :int         =   attention_dropout
					snake_case__      :Any         =   activation
					snake_case__      :List[Any]         =   initializer_range
					snake_case__      :Optional[int]         =   qa_dropout
					snake_case__      :Union[str, Any]         =   seq_classif_dropout
					super().__init__(**UpperCamelCase					,pad_token_id=UpperCamelCase       )




class 					_snake_case						(			_A ):






	@property
	def    lowerCAmelCase_							(		self       )						->    Mapping[str, Mapping[int, str]]:
					if self.task == "multiple-choice":
									snake_case__      :Optional[int]         =   {0: "batch", 1: "choice", 2: "sequence"}
					else:
									snake_case__      :List[str]         =   {0: "batch", 1: "sequence"}
					return OrderedDict(
					    [
					        ("input_ids", dynamic_axis),
					        ("attention_mask", dynamic_axis),
					    ]       )












def 					lowercase_ (    __snake_case     :							str      )     -> list:





				'''simple docstring'''


				return [
				    txt[:a] + txt[a].upper() + txt[a + 1 :]
				    for a in range(len(__snake_case      )      )
				    if txt[a].isalpha()
				]


if __name__ == "__main__":
	__import__("doctest").testmod()