'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tensorflow_text_available, is_torch_available


SCREAMING_SNAKE_CASE_:     int  ={
    'configuration_ernie': ['ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ErnieConfig', 'ErnieOnnxConfig'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    SCREAMING_SNAKE_CASE_:     List[str]  =[
        'ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST',
        'ErnieForCausalLM',
        'ErnieForMaskedLM',
        'ErnieForMultipleChoice',
        'ErnieForNextSentencePrediction',
        'ErnieForPreTraining',
        'ErnieForQuestionAnswering',
        'ErnieForSequenceClassification',
        'ErnieForTokenClassification',
        'ErnieModel',
        'ErniePreTrainedModel',
    ]

if TYPE_CHECKING:
    from .configuration_ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig, ErnieOnnxConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_ernie import (
            ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST,
            ErnieForCausalLM,
            ErnieForMaskedLM,
            ErnieForMultipleChoice,
            ErnieForNextSentencePrediction,
            ErnieForPreTraining,
            ErnieForQuestionAnswering,
            ErnieForSequenceClassification,
            ErnieForTokenClassification,
            ErnieModel,
            ErniePreTrainedModel,
        )

else:
    import sys

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





'''simple docstring'''





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

from ..bert.test_tokenization_bert import BertTokenizationTest




@require_tokenizers
class        __A      ( UpperCamelCase__	):
    a__       :						Optional[Any]          =  DistilBertTokenizer
    a__       :						Any          =  DistilBertTokenizerFast
    a__       :						str          =  True



    @slow
    def 					_lowercase						(self    :    int ):
         UpperCAmelCase_           =   DistilBertTokenizer.from_pretrained("distilbert-base-uncased" )

         UpperCAmelCase_           =   tokenizer.encode("sequence builders"   ,			add_special_tokens=__a )
         UpperCAmelCase_           =   tokenizer.encode("multi-sequence build"   ,			add_special_tokens=__a )

         UpperCAmelCase_           =   tokenizer.build_inputs_with_special_tokens(__a )
         UpperCAmelCase_           =   tokenizer.build_inputs_with_special_tokens(__a   ,			__a )

         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
         ]




