import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    MODEL_FOR_PRETRAINING_MAPPING,
							    AlbertForMaskedLM,
							    AlbertForMultipleChoice,
							    AlbertForPreTraining,
							    AlbertForQuestionAnswering,
							    AlbertForSequenceClassification,
							    AlbertForTokenClassification,
							    AlbertModel,
							)
							from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST


class   lowercase      :




							def __init__(  self				:   Optional[int]		,							_UpperCamelCase				:   Optional[Any]		,							_UpperCamelCase				:   Optional[int]=13		,							_UpperCamelCase				:   str=7		,							_UpperCamelCase				:   Union[str, Any]=True		,							_UpperCamelCase				:   str=True		,							_UpperCamelCase				:   Optional[int]=True		,							_UpperCamelCase				:   Tuple=True		,							_UpperCamelCase				:   Dict=99		,							_UpperCamelCase				:   Optional[Any]=16		,							_UpperCamelCase				:   Union[str, Any]=36		,							_UpperCamelCase				:   Optional[int]=6		,							_UpperCamelCase				:   Dict=6		,							_UpperCamelCase				:   Dict=6		,							_UpperCamelCase				:   List[str]=37		,							_UpperCamelCase				:   Optional[int]="gelu"		,							_UpperCamelCase				:   List[Any]=0.1		,							_UpperCamelCase				:   Any=0.1		,							_UpperCamelCase				:   List[str]=512		,							_UpperCamelCase				:   List[Any]=16		,							_UpperCamelCase				:   Any=2		,							_UpperCamelCase				:   List[str]=0.0_2		,							_UpperCamelCase				:   str=3		,							_UpperCamelCase				:   str=4		,							_UpperCamelCase				:   List[str]=None		,							)   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    parent
												SCREAMING_SNAKE_CASE           =    batch_size
												SCREAMING_SNAKE_CASE           =    seq_length
												SCREAMING_SNAKE_CASE           =    is_training
												SCREAMING_SNAKE_CASE           =    use_input_mask
												SCREAMING_SNAKE_CASE           =    use_token_type_ids
												SCREAMING_SNAKE_CASE           =    use_labels
												SCREAMING_SNAKE_CASE           =    vocab_size
												SCREAMING_SNAKE_CASE           =    embedding_size
												SCREAMING_SNAKE_CASE           =    hidden_size
												SCREAMING_SNAKE_CASE           =    num_hidden_layers
												SCREAMING_SNAKE_CASE           =    num_hidden_groups
												SCREAMING_SNAKE_CASE           =    num_attention_heads
												SCREAMING_SNAKE_CASE           =    intermediate_size
												SCREAMING_SNAKE_CASE           =    hidden_act
												SCREAMING_SNAKE_CASE           =    hidden_dropout_prob
												SCREAMING_SNAKE_CASE           =    attention_probs_dropout_prob
												SCREAMING_SNAKE_CASE           =    max_position_embeddings
												SCREAMING_SNAKE_CASE           =    type_vocab_size
												SCREAMING_SNAKE_CASE           =    type_sequence_label_size
												SCREAMING_SNAKE_CASE           =    initializer_range
												SCREAMING_SNAKE_CASE           =    num_labels
												SCREAMING_SNAKE_CASE           =    num_choices
												SCREAMING_SNAKE_CASE           =    scope




							def 		__snake_case(  self				:   List[Any] )   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.vocab_size )

												SCREAMING_SNAKE_CASE           =    None
												if self.use_input_mask:
																	SCREAMING_SNAKE_CASE           =    random_attention_mask([self.batch_size, self.seq_length] )

												SCREAMING_SNAKE_CASE           =    None
												if self.use_token_type_ids:
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.type_vocab_size )

												SCREAMING_SNAKE_CASE           =    None
												SCREAMING_SNAKE_CASE           =    None
												SCREAMING_SNAKE_CASE           =    None
												if self.use_labels:
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size]		,							self.type_sequence_label_size )
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.num_labels )
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size]		,							self.num_choices )

												SCREAMING_SNAKE_CASE           =    self.get_config()

												return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels




							def 		__snake_case(  self				:   int )   ->			List[str]:



												'''simple docstring'''

												return AlbertConfig(
												    vocab_size=self.vocab_size		,							hidden_size=self.hidden_size		,							num_hidden_layers=self.num_hidden_layers		,							num_attention_heads=self.num_attention_heads		,							intermediate_size=self.intermediate_size		,							hidden_act=self.hidden_act		,							hidden_dropout_prob=self.hidden_dropout_prob		,							attention_probs_dropout_prob=self.attention_probs_dropout_prob		,							max_position_embeddings=self.max_position_embeddings		,							type_vocab_size=self.type_vocab_size		,							initializer_range=self.initializer_range		,							num_hidden_groups=self.num_hidden_groups		,							)




							def 		__snake_case(  self				:   Optional[int]		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Tuple )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModel(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							token_type_ids=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase )
												self.parent.assertEqual(result.last_hidden_state.shape		,							(self.batch_size, self.seq_length, self.hidden_size) )
												self.parent.assertEqual(result.pooler_output.shape		,							(self.batch_size, self.hidden_size) )




							def 		__snake_case(  self				:   List[Any]		,							_UpperCamelCase				:   int		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   int )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForPreTraining(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase		,							sentence_order_label=_UpperCamelCase		,							)
												self.parent.assertEqual(result.prediction_logits.shape		,							(self.batch_size, self.seq_length, self.vocab_size) )
												self.parent.assertEqual(result.sop_logits.shape		,							(self.batch_size, config.num_labels) )




							def 		__snake_case(  self				:   List[Any]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   int		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Optional[Any] )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForMaskedLM(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.seq_length, self.vocab_size) )




							def 		__snake_case(  self				:   Union[str, Any]		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   int )   ->			Optional[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForQuestionAnswering(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							start_positions=_UpperCamelCase		,							end_positions=_UpperCamelCase		,							)
												self.parent.assertEqual(result.start_logits.shape		,							(self.batch_size, self.seq_length) )
												self.parent.assertEqual(result.end_logits.shape		,							(self.batch_size, self.seq_length) )




							def 		__snake_case(  self				:   Any		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Optional[Any] )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_labels
												SCREAMING_SNAKE_CASE           =    AlbertForSequenceClassification(_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.num_labels) )




							def 		__snake_case(  self				:   Optional[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   str )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_labels
												SCREAMING_SNAKE_CASE           =    AlbertForTokenClassification(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.seq_length, self.num_labels) )




							def 		__snake_case(  self				:   str		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   List[str] )   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_choices
												SCREAMING_SNAKE_CASE           =    AlbertForMultipleChoice(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    input_ids.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    token_type_ids.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    input_mask.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase		,							)
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.num_choices) )





							def 		__snake_case(  self				:   Dict )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.prepare_config_and_inputs()
												(
												    (
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,				(
												    SCREAMING_SNAKE_CASE				
												)     ,								
												)           =    config_and_inputs
												SCREAMING_SNAKE_CASE           =    {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
												return config, inputs_dict



@require_torch
class   lowercase      (       a			,    a			,    unittest.TestCase       ):
							lowercase__  :    Tuple									=							(
							    (
							        AlbertModel,
							        AlbertForPreTraining,
							        AlbertForMaskedLM,
							        AlbertForMultipleChoice,
							        AlbertForSequenceClassification,
							        AlbertForTokenClassification,
							        AlbertForQuestionAnswering,
							    )
							    if is_torch_available()
							    else ()
							)
							lowercase__  :    str									=							(
							    {
							        """feature-extraction""": AlbertModel,
							        """fill-mask""": AlbertForMaskedLM,
							        """question-answering""": AlbertForQuestionAnswering,
							        """text-classification""": AlbertForSequenceClassification,
							        """token-classification""": AlbertForTokenClassification,
							        """zero-shot""": AlbertForSequenceClassification,
							    }
							    if is_torch_available()
							    else {}
							)
							lowercase__  :    str									=							True




							def 		__snake_case(  self				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   str=False )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    super()._prepare_for_class(_UpperCamelCase		,							_UpperCamelCase		,							return_labels=_UpperCamelCase )

												if return_labels:
																	if model_class in get_values(_UpperCamelCase ):
																						SCREAMING_SNAKE_CASE           =    torch.zeros(
																						    (self.model_tester.batch_size, self.model_tester.seq_length)		,							dtype=torch.long		,							device=_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    torch.zeros(
																						    self.model_tester.batch_size		,							dtype=torch.long		,							device=_UpperCamelCase )
												return inputs_dict




							def 		__snake_case(  self				:   Optional[int] )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModelTester(self )
												SCREAMING_SNAKE_CASE           =    ConfigTester(self		,							config_class=_UpperCamelCase		,							hidden_size=37 )




							def 		__snake_case(  self				:   List[Any] )   ->			Optional[int]:



												'''simple docstring'''

												self.config_tester.run_common_tests()




							def 		__snake_case(  self				:   List[str] )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_model(*_UpperCamelCase )




							def 		__snake_case(  self				:   Union[str, Any] )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_pretraining(*_UpperCamelCase )




							def 		__snake_case(  self				:   List[str] )   ->			Dict:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_masked_lm(*_UpperCamelCase )




							def 		__snake_case(  self				:   str )   ->			Tuple:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_multiple_choice(*_UpperCamelCase )




							def 		__snake_case(  self				:   Dict )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_question_answering(*_UpperCamelCase )




							def 		__snake_case(  self				:   Tuple )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_sequence_classification(*_UpperCamelCase )




							def 		__snake_case(  self				:   int )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												for type in ["absolute", "relative_key", "relative_key_query"]:
																	SCREAMING_SNAKE_CASE           =    type
																	self.model_tester.create_and_check_model(*_UpperCamelCase )





							@slow
							def 		__snake_case(  self				:   List[str] )   ->			str:



												'''simple docstring'''

												for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																	SCREAMING_SNAKE_CASE           =    AlbertModel.from_pretrained(_UpperCamelCase )
																	self.assertIsNotNone(_UpperCamelCase )



@require_torch
class   lowercase      (       unittest.TestCase       ):




							@slow
							def 		__snake_case(  self				:   Any )   ->			List[str]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModel.from_pretrained("albert-base-v2" )
												SCREAMING_SNAKE_CASE           =    torch.tensor([[0, 345, 232, 328, 740, 140, 1_695, 69, 6_078, 1_588, 2]] )
												SCREAMING_SNAKE_CASE           =    torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]] )
												with torch.no_grad():
																	SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase )[0]
												SCREAMING_SNAKE_CASE           =    torch.Size((1, 11, 768) )
												self.assertEqual(output.shape		,							_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    torch.tensor(
												    [[[-0.6_5_1_3, 1.5_0_3_5, -0.2_7_6_6], [-0.6_5_1_5, 1.5_0_4_6, -0.2_7_8_0], [-0.6_5_1_2, 1.5_0_4_9, -0.2_7_8_4]]] )

												self.assertTrue(torch.allclose(output[:, 1:4, 1:4]		,							_UpperCamelCase		,							atol=1e-4 ) )





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_funnel import FunnelTokenizer


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

_lowerCamelCase   :				Dict     			=						{'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

_lowerCamelCase   :				List[Any]     			=						[
    '''small''',
    '''small-base''',
    '''medium''',
    '''medium-base''',
    '''intermediate''',
    '''intermediate-base''',
    '''large''',
    '''large-base''',
    '''xlarge''',
    '''xlarge-base''',
]

_lowerCamelCase   :				Optional[Any]     			=						{
    '''vocab_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt''',
        '''funnel-transformer/small-base''': '''https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt''',
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt''',
        '''funnel-transformer/large-base''': '''https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json''',
        '''funnel-transformer/small-base''': (
            '''https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json''',
        '''funnel-transformer/large-base''': (
            '''https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json'''
        ),
    },
}
_lowerCamelCase   :				Any     			=						{f"""funnel-transformer/{name}""": 5_12 for name in _model_names}
_lowerCamelCase   :				Optional[Any]     			=						{f"""funnel-transformer/{name}""": {'''do_lower_case''': True} for name in _model_names}


class   lowercase      (       a       ):
							lowercase__  :    Optional[int]									=							VOCAB_FILES_NAMES
							lowercase__  :    Optional[Any]									=							PRETRAINED_VOCAB_FILES_MAP
							lowercase__  :    Optional[Any]									=							PRETRAINED_INIT_CONFIGURATION
							lowercase__  :    Union[str, Any]									=							FunnelTokenizer
							lowercase__  :    List[Any]									=							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							lowercase__  :    int									=							2




							def __init__(  self				:   str		,							_UpperCamelCase				:   str=None		,							_UpperCamelCase				:   str=None		,							_UpperCamelCase				:   Union[str, Any]=True		,							_UpperCamelCase				:   str="<unk>"		,							_UpperCamelCase				:   Optional[Any]="<sep>"		,							_UpperCamelCase				:   Optional[int]="<pad>"		,							_UpperCamelCase				:   int="<cls>"		,							_UpperCamelCase				:   Dict="<mask>"		,							_UpperCamelCase				:   Union[str, Any]="<s>"		,							_UpperCamelCase				:   Optional[int]="</s>"		,							_UpperCamelCase				:   Dict=True		,							_UpperCamelCase				:   List[Any]=True		,							_UpperCamelCase				:   Any=None		,							_UpperCamelCase				:   Dict="##"		,							**_UpperCamelCase				:   Dict		,							)   ->			Optional[int]:



												'''simple docstring'''

												super().__init__(
												    _UpperCamelCase		,							tokenizer_file=_UpperCamelCase		,							do_lower_case=_UpperCamelCase		,							unk_token=_UpperCamelCase		,							sep_token=_UpperCamelCase		,							pad_token=_UpperCamelCase		,							cls_token=_UpperCamelCase		,							mask_token=_UpperCamelCase		,							bos_token=_UpperCamelCase		,							eos_token=_UpperCamelCase		,							clean_text=_UpperCamelCase		,							tokenize_chinese_chars=_UpperCamelCase		,							strip_accents=_UpperCamelCase		,							wordpieces_prefix=_UpperCamelCase		,							**_UpperCamelCase		,							)

												SCREAMING_SNAKE_CASE           =    json.loads(self.backend_tokenizer.normalizer.__getstate__() )
												if (
												    normalizer_state.get("lowercase"		,							_UpperCamelCase ) != do_lower_case
												    or normalizer_state.get("strip_accents"		,							_UpperCamelCase ) != strip_accents
												    or normalizer_state.get("handle_chinese_chars"		,							_UpperCamelCase ) != tokenize_chinese_chars
												):
																	SCREAMING_SNAKE_CASE           =    getattr(_UpperCamelCase		,							normalizer_state.pop("type" ) )
																	SCREAMING_SNAKE_CASE           =    do_lower_case
																	SCREAMING_SNAKE_CASE           =    strip_accents
																	SCREAMING_SNAKE_CASE           =    tokenize_chinese_chars
																	SCREAMING_SNAKE_CASE           =    normalizer_class(**_UpperCamelCase )

												SCREAMING_SNAKE_CASE           =    do_lower_case




							def 		__snake_case(  self				:   Union[str, Any]		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   Dict=None )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    [self.cls_token_id] + token_ids_a + [self.sep_token_id]

												if token_ids_a:
																	output += token_ids_a + [self.sep_token_id]

												return output




							def 		__snake_case(  self				:   int		,							_UpperCamelCase				:   List[int]		,							_UpperCamelCase				:   Optional[List[int]] = None )   ->			List[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    [self.sep_token_id]
												SCREAMING_SNAKE_CASE           =    [self.cls_token_id]
												if token_ids_a is None:
																	return len(cls ) * [self.cls_token_type_id] + len(token_ids_a + sep ) * [0]
												return len(cls ) * [self.cls_token_type_id] + len(token_ids_a + sep ) * [0] + len(token_ids_a + sep ) * [1]





							def 		__snake_case(  self				:   Optional[Any]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   Optional[str] = None )   ->			Tuple[str]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self._tokenizer.model.save(_UpperCamelCase		,							name=_UpperCamelCase )
												return tuple(_UpperCamelCase )




