


"""simple docstring"""


from collections import OrderedDict
from typing import Mapping

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


A     :   str			    =			logging.get_logger(__name__)

A     :   List[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   _UpperCamelCase  (   lowerCAmelCase__		):
							'''simple docstring'''







							__UpperCAmelCase						:    Any				      ="""distilbert"""
							__UpperCAmelCase						:    List[str]				      ={
							    """hidden_size""": """dim""",
							    """num_attention_heads""": """n_heads""",
							    """num_hidden_layers""": """n_layers""",
							}

							def __init__(     self    ,   __a=3_05_22    ,   __a=5_12    ,   __a=False    ,   __a=6    ,   __a=12    ,   __a=7_68    ,   __a=4 * 7_68    ,   __a=0.1    ,   __a=0.1    ,   __a="gelu"    ,   __a=0.0_2    ,   __a=0.1    ,   __a=0.2    ,   __a=0    ,   **__a    ,   ):
										__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__(**__a    ,   pad_token_id=__a	)
class   _UpperCamelCase  (   lowerCAmelCase__		):
							'''simple docstring'''







							@property
							def 			snake_case				(     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),
										    ]	)










from transformers import DistilBertTokenizer, DistilBertTokenizerFast
from transformers.testing_utils import require_tokenizers, slow

from ..bert.test_tokenization_bert import BertTokenizationTest





@require_tokenizers
class     lowerCamelCase__(					__lowerCamelCase):
      UpperCAmelCase__      :	Dict    		=   DistilBertTokenizer
      UpperCAmelCase__      :	Dict    		=   DistilBertTokenizerFast
      UpperCAmelCase__      :	Tuple    		=   True
      @slow
      def 			lowerCAmelCase__						(				self: Tuple   ):
             __lowerCamelCase   =						DistilBertTokenizer.from_pretrained("""distilbert-base-uncased"""   )

             __lowerCamelCase   =						tokenizer.encode("""sequence builders"""    ,       add_special_tokens=UpperCamelCase_   )
             __lowerCamelCase   =						tokenizer.encode("""multi-sequence build"""    ,       add_special_tokens=UpperCamelCase_   )

             __lowerCamelCase   =						tokenizer.build_inputs_with_special_tokens(UpperCamelCase_   )
             __lowerCamelCase   =						tokenizer.build_inputs_with_special_tokens(UpperCamelCase_    ,       UpperCamelCase_   )

             assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]
             assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [
                 tokenizer.sep_token_id
             ]

