






import os
import tempfile
import unittest

from transformers import FlaubertConfig, is_torch_available
from transformers.testing_utils import require_torch, require_torch_gpu, 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 (
           FlaubertForMultipleChoice,
           FlaubertForQuestionAnswering,
           FlaubertForQuestionAnsweringSimple,
           FlaubertForSequenceClassification,
           FlaubertForTokenClassification,
           FlaubertModel,
           FlaubertWithLMHeadModel,
       )
       from transformers.models.flaubert.modeling_flaubert import FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST





class 					A__     (     __snake_case ):

     '''simple docstring'''






     def __init__( self      :    Any   ,						_SCREAMING_SNAKE_CASE      :    List[Any]   ,						_SCREAMING_SNAKE_CASE      :    Dict=13   ,						_SCREAMING_SNAKE_CASE      :    str=7   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]=True   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]=True   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]=True   ,						_SCREAMING_SNAKE_CASE      :    int=True   ,						_SCREAMING_SNAKE_CASE      :    List[str]=True   ,						_SCREAMING_SNAKE_CASE      :    int=False   ,						_SCREAMING_SNAKE_CASE      :    Any=False   ,						_SCREAMING_SNAKE_CASE      :    int=False   ,						_SCREAMING_SNAKE_CASE      :    Any=2   ,						_SCREAMING_SNAKE_CASE      :    Tuple=99   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]=0   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]=32   ,						_SCREAMING_SNAKE_CASE      :    int=5   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]=4   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]=0.1   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]=0.1   ,						_SCREAMING_SNAKE_CASE      :    int=512   ,						_SCREAMING_SNAKE_CASE      :    int=12   ,						_SCREAMING_SNAKE_CASE      :    List[str]=2   ,						_SCREAMING_SNAKE_CASE      :    List[Any]=0.0_2   ,						_SCREAMING_SNAKE_CASE      :    int=3   ,						_SCREAMING_SNAKE_CASE      :    str=4   ,						_SCREAMING_SNAKE_CASE      :    Tuple="last"   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]=None   ,						_SCREAMING_SNAKE_CASE      :    Any=None   ,						):






           """simple docstring"""




           UpperCamelCase					       =  parent
           UpperCamelCase					       =  batch_size
           UpperCamelCase					       =  seq_length
           UpperCamelCase					       =  is_training
           UpperCamelCase					       =  use_input_lengths
           UpperCamelCase					       =  use_token_type_ids
           UpperCamelCase					       =  use_labels
           UpperCamelCase					       =  gelu_activation
           UpperCamelCase					       =  sinusoidal_embeddings
           UpperCamelCase					       =  causal
           UpperCamelCase					       =  asm
           UpperCamelCase					       =  n_langs
           UpperCamelCase					       =  vocab_size
           UpperCamelCase					       =  n_special
           UpperCamelCase					       =  hidden_size
           UpperCamelCase					       =  num_hidden_layers
           UpperCamelCase					       =  num_attention_heads
           UpperCamelCase					       =  hidden_dropout_prob
           UpperCamelCase					       =  attention_probs_dropout_prob
           UpperCamelCase					       =  max_position_embeddings
           UpperCamelCase					       =  type_vocab_size
           UpperCamelCase					       =  type_sequence_label_size
           UpperCamelCase					       =  initializer_range
           UpperCamelCase					       =  num_labels
           UpperCamelCase					       =  num_choices
           UpperCamelCase					       =  summary_type
           UpperCamelCase					       =  use_proj
           UpperCamelCase					       =  scope







     def   _SCREAMING_SNAKE_CASE     ( self      :    str ):






           """simple docstring"""




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

           UpperCamelCase					       =  None
           if self.use_input_lengths:
                 UpperCamelCase					       =  (
                     ids_tensor([self.batch_size]   ,						vocab_size=2 ) + self.seq_length - 2
                 )  # small variation of seq_length

           UpperCamelCase					       =  None
           if self.use_token_type_ids:
                 UpperCamelCase					       =  ids_tensor([self.batch_size, self.seq_length]   ,						self.n_langs )

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

           UpperCamelCase					       =  self.get_config()

           return (
               config,
               input_ids,
               token_type_ids,
               input_lengths,
               sequence_labels,
               token_labels,
               is_impossible_labels,
               choice_labels,
               input_mask,
           )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Any ):






           """simple docstring"""




           return FlaubertConfig(
               vocab_size=self.vocab_size   ,						n_special=self.n_special   ,						emb_dim=self.hidden_size   ,						n_layers=self.num_hidden_layers   ,						n_heads=self.num_attention_heads   ,						dropout=self.hidden_dropout_prob   ,						attention_dropout=self.attention_probs_dropout_prob   ,						gelu_activation=self.gelu_activation   ,						sinusoidal_embeddings=self.sinusoidal_embeddings   ,						asm=self.asm   ,						causal=self.causal   ,						n_langs=self.n_langs   ,						max_position_embeddings=self.max_position_embeddings   ,						initializer_range=self.initializer_range   ,						summary_type=self.summary_type   ,						use_proj=self.use_proj   ,						)







     def   _SCREAMING_SNAKE_CASE     ( self      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Any   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    Any   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertModel(config=_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()
           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						lengths=_SCREAMING_SNAKE_CASE   ,						langs=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						langs=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE )
           self.parent.assertEqual(result.last_hidden_state.shape   ,						(self.batch_size, self.seq_length, self.hidden_size) )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    List[Any]   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertWithLMHeadModel(_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						token_type_ids=_SCREAMING_SNAKE_CASE   ,						labels=_SCREAMING_SNAKE_CASE )
           self.parent.assertEqual(result.loss.shape   ,						() )
           self.parent.assertEqual(result.logits.shape   ,						(self.batch_size, self.seq_length, self.vocab_size) )







     def   _SCREAMING_SNAKE_CASE     ( self      :    int   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    int   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    List[Any]   ,						):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertForQuestionAnsweringSimple(_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						start_positions=_SCREAMING_SNAKE_CASE   ,						end_positions=_SCREAMING_SNAKE_CASE )
           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   _SCREAMING_SNAKE_CASE     ( self      :    int   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    Tuple   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertForQuestionAnswering(_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  model(
               _SCREAMING_SNAKE_CASE   ,						start_positions=_SCREAMING_SNAKE_CASE   ,						end_positions=_SCREAMING_SNAKE_CASE   ,						cls_index=_SCREAMING_SNAKE_CASE   ,						is_impossible=_SCREAMING_SNAKE_CASE   ,						p_mask=_SCREAMING_SNAKE_CASE   ,						)

           UpperCamelCase					       =  model(
               _SCREAMING_SNAKE_CASE   ,						start_positions=_SCREAMING_SNAKE_CASE   ,						end_positions=_SCREAMING_SNAKE_CASE   ,						cls_index=_SCREAMING_SNAKE_CASE   ,						is_impossible=_SCREAMING_SNAKE_CASE   ,						)

           ((UpperCamelCase)       ,  )					       =  result_with_labels.to_tuple()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						start_positions=_SCREAMING_SNAKE_CASE   ,						end_positions=_SCREAMING_SNAKE_CASE )

           ((UpperCamelCase)       ,  )					       =  result_with_labels.to_tuple()

           self.parent.assertEqual(result_with_labels.loss.shape   ,						() )
           self.parent.assertEqual(result.start_top_log_probs.shape   ,						(self.batch_size, model.config.start_n_top) )
           self.parent.assertEqual(result.start_top_index.shape   ,						(self.batch_size, model.config.start_n_top) )
           self.parent.assertEqual(
               result.end_top_log_probs.shape   ,						(self.batch_size, model.config.start_n_top * model.config.end_n_top) )
           self.parent.assertEqual(
               result.end_top_index.shape   ,						(self.batch_size, model.config.start_n_top * model.config.end_n_top) )
           self.parent.assertEqual(result.cls_logits.shape   ,						(self.batch_size,) )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Tuple   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertForSequenceClassification(_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						labels=_SCREAMING_SNAKE_CASE )

           self.parent.assertEqual(result.loss.shape   ,						() )
           self.parent.assertEqual(result.logits.shape   ,						(self.batch_size, self.type_sequence_label_size) )







     def   _SCREAMING_SNAKE_CASE     ( self      :    List[Any]   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    int   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Tuple   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						):






           """simple docstring"""




           UpperCamelCase					       =  self.num_labels
           UpperCamelCase					       =  FlaubertForTokenClassification(_SCREAMING_SNAKE_CASE )
           model.to(_SCREAMING_SNAKE_CASE )
           model.eval()

           UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE   ,						attention_mask=_SCREAMING_SNAKE_CASE   ,						labels=_SCREAMING_SNAKE_CASE )
           self.parent.assertEqual(result.logits.shape   ,						(self.batch_size, self.seq_length, self.num_labels) )







     def   _SCREAMING_SNAKE_CASE     ( self      :    int   ,						_SCREAMING_SNAKE_CASE      :    int   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Dict   ,						_SCREAMING_SNAKE_CASE      :    Tuple   ,						_SCREAMING_SNAKE_CASE      :    Any   ,						_SCREAMING_SNAKE_CASE      :    Optional[int]   ,						_SCREAMING_SNAKE_CASE      :    Any   ,						_SCREAMING_SNAKE_CASE      :    int   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						):






           """simple docstring"""




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







     def   _SCREAMING_SNAKE_CASE     ( self      :    int ):






           """simple docstring"""




           UpperCamelCase					       =  self.prepare_config_and_inputs()
           (
               (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  (
               UpperCamelCase
           )       ,  
           )					       =  config_and_inputs
           UpperCamelCase					       =  {
               'input_ids': input_ids,
               'token_type_ids': token_type_ids,
               'lengths': input_lengths,
               'attention_mask': input_mask,
           }
           return config, inputs_dict





@require_torch
class 					A__     (     __snake_case   ,    __snake_case   ,    unittest.TestCase ):

     '''simple docstring'''






     snake_case__					=					(
         (
             FlaubertModel,
             FlaubertWithLMHeadModel,
             FlaubertForQuestionAnswering,
             FlaubertForQuestionAnsweringSimple,
             FlaubertForSequenceClassification,
             FlaubertForTokenClassification,
             FlaubertForMultipleChoice,
         )
         if is_torch_available()
         else ()
     )
     snake_case__					=					(
         {
             """feature-extraction""": FlaubertModel,
             """fill-mask""": FlaubertWithLMHeadModel,
             """question-answering""": FlaubertForQuestionAnsweringSimple,
             """text-classification""": FlaubertForSequenceClassification,
             """token-classification""": FlaubertForTokenClassification,
             """zero-shot""": FlaubertForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )







     def   _SCREAMING_SNAKE_CASE     ( self      :    str   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any]   ,						_SCREAMING_SNAKE_CASE      :    List[str]   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    int ):






           """simple docstring"""




           if (
               pipeline_test_casse_name == "QAPipelineTests"
               and tokenizer_name is not None
               and not tokenizer_name.endswith('Fast' )
           ):
                 # `QAPipelineTests` fails for a few models when the slower tokenizer are used.
                 # (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
                 # TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
                 return True

           return False







     def   _SCREAMING_SNAKE_CASE     ( self      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    str   ,						_SCREAMING_SNAKE_CASE      :    Union[str, Any]   ,						_SCREAMING_SNAKE_CASE      :    Tuple=False ):






           """simple docstring"""




           UpperCamelCase					       =  super()._prepare_for_class(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE   ,						return_labels=_SCREAMING_SNAKE_CASE )

           if return_labels:
                 if model_class.__name__ == "FlaubertForQuestionAnswering":
                       UpperCamelCase					       =  torch.zeros(
                           self.model_tester.batch_size   ,						dtype=torch.long   ,						device=_SCREAMING_SNAKE_CASE )
                       UpperCamelCase					       =  torch.zeros(
                           self.model_tester.batch_size   ,						dtype=torch.long   ,						device=_SCREAMING_SNAKE_CASE )

           return inputs_dict







     def   _SCREAMING_SNAKE_CASE     ( self      :    str ):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertModelTester(self )
           UpperCamelCase					       =  ConfigTester(self   ,						config_class=_SCREAMING_SNAKE_CASE   ,						emb_dim=37 )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[int] ):






           """simple docstring"""




           self.config_tester.run_common_tests()







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_model(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_lm_head(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Union[str, Any] ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_simple_qa(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    List[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_qa(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    int ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_sequence_classif(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    str ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_token_classif(*_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Any ):






           """simple docstring"""




           UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_flaubert_multiple_choice(*_SCREAMING_SNAKE_CASE )







     @slow
     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[Any] ):






           """simple docstring"""




           for model_name in FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 UpperCamelCase					       =  FlaubertModel.from_pretrained(_SCREAMING_SNAKE_CASE )
                 self.assertIsNotNone(_SCREAMING_SNAKE_CASE )







     @slow
     @require_torch_gpu
     def   _SCREAMING_SNAKE_CASE     ( self      :    Dict ):






           """simple docstring"""




           UpperCamelCase       ,  UpperCamelCase					       =  self.model_tester.prepare_config_and_inputs_for_common()
           for model_class in self.all_model_classes:
                 # FlauBertForMultipleChoice behaves incorrectly in JIT environments.
                 if model_class == FlaubertForMultipleChoice:
                       return

                 UpperCamelCase					       =  True
                 UpperCamelCase					       =  model_class(config=_SCREAMING_SNAKE_CASE )

                 UpperCamelCase					       =  self._prepare_for_class(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
                 UpperCamelCase					       =  torch.jit.trace(
                     _SCREAMING_SNAKE_CASE   ,						(inputs_dict['input_ids'].to('cpu' ), inputs_dict['attention_mask'].to('cpu' )) )

                 with tempfile.TemporaryDirectory() as tmp:
                       torch.jit.save(_SCREAMING_SNAKE_CASE   ,						os.path.join(_SCREAMING_SNAKE_CASE   ,						'traced_model.pt' ) )
                       UpperCamelCase					       =  torch.jit.load(os.path.join(_SCREAMING_SNAKE_CASE   ,						'traced_model.pt' )   ,						map_location=_SCREAMING_SNAKE_CASE )
                       loaded(inputs_dict['input_ids'].to(_SCREAMING_SNAKE_CASE )   ,						inputs_dict['attention_mask'].to(_SCREAMING_SNAKE_CASE ) )





@require_torch
class 					A__     (     unittest.TestCase ):

     '''simple docstring'''






     @slow
     def   _SCREAMING_SNAKE_CASE     ( self      :    Union[str, Any] ):






           """simple docstring"""




           UpperCamelCase					       =  FlaubertModel.from_pretrained('flaubert/flaubert_base_cased' )
           UpperCamelCase					       =  torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]] )
           with torch.no_grad():
                 UpperCamelCase					       =  model(_SCREAMING_SNAKE_CASE )[0]
           UpperCamelCase					       =  torch.Size((1, 11, 768) )
           self.assertEqual(output.shape   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  torch.tensor(
               [[[-2.6_2_5_1, -1.4_2_9_8, -0.0_2_2_7], [-2.8_5_1_0, -1.6_3_8_7, 0.2_2_5_8], [-2.8_1_1_4, -1.1_8_3_2, -0.3_0_6_6]]] )

           self.assertTrue(torch.allclose(output[:, :3, :3]   ,						_SCREAMING_SNAKE_CASE   ,						atol=1E-4 ) )











import unittest

from transformers import DebertaVaTokenizer, DebertaVaTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


__magic_name__   :  Optional[int]        =							get_tests_dir('''fixtures/spiece.model''')





@require_sentencepiece
@require_tokenizers
class 					A__     (     __snake_case   ,    unittest.TestCase ):

     '''simple docstring'''






     snake_case__					=					DebertaVaTokenizer
     snake_case__					=					DebertaVaTokenizerFast
     snake_case__					=					True
     snake_case__					=					True







     def   _SCREAMING_SNAKE_CASE     ( self      :    Tuple ):






           """simple docstring"""




           super().setUp()

           # We have a SentencePiece fixture for testing
           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						unk_token='<unk>' )
           tokenizer.save_pretrained(self.tmpdirname )







     def   _SCREAMING_SNAKE_CASE     ( self      :    List[Any]   ,						_SCREAMING_SNAKE_CASE      :    Optional[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  'this is a test'
           UpperCamelCase					       =  'this is a test'
           return input_text, output_text







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  '<pad>'
           UpperCamelCase					       =  0

           self.assertEqual(self.get_tokenizer()._convert_token_to_id(_SCREAMING_SNAKE_CASE )   ,						_SCREAMING_SNAKE_CASE )
           self.assertEqual(self.get_tokenizer()._convert_id_to_token(_SCREAMING_SNAKE_CASE )   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Dict ):






           """simple docstring"""




           UpperCamelCase					       =  list(self.get_tokenizer().get_vocab().keys() )
           self.assertEqual(vocab_keys[0]   ,						'<pad>' )
           self.assertEqual(vocab_keys[1]   ,						'<unk>' )
           self.assertEqual(vocab_keys[-1]   ,						'[PAD]' )
           self.assertEqual(len(_SCREAMING_SNAKE_CASE )   ,						3_0001 )







     def   _SCREAMING_SNAKE_CASE     ( self      :    str ):






           """simple docstring"""




           self.assertEqual(self.get_tokenizer().vocab_size   ,						3_0000 )







     def   _SCREAMING_SNAKE_CASE     ( self      :    int ):






           """simple docstring"""




           UpperCamelCase					       =  ' \tHeLLo!how  \n Are yoU?  '
           UpperCamelCase					       =  ['▁hello', '!', 'how', '▁are', '▁you', '?']
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     @unittest.skip('There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.' )
     def   _SCREAMING_SNAKE_CASE     ( self      :    int ):






           """simple docstring"""




           pass







     @unittest.skip('There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.' )
     def   _SCREAMING_SNAKE_CASE     ( self      :    Any ):






           """simple docstring"""




           pass







     def   _SCREAMING_SNAKE_CASE     ( self      :    int ):






           """simple docstring"""




           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'
           UpperCamelCase					       =  ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    str ):






           """simple docstring"""




           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'
           UpperCamelCase					       =  ['▁i', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Tuple ):






           """simple docstring"""




           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'
           UpperCamelCase					       =  ['▁i', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '.', ]
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    List[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'
           UpperCamelCase					       =  ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Tuple ):






           """simple docstring"""




           UpperCamelCase					       =  ' \tHeLLo!how  \n Are yoU?  '
           UpperCamelCase					       =  ['▁', '<unk>', 'e', '<unk>', 'o', '!', 'how', '▁', '<unk>', 're', '▁yo', '<unk>', '?']
           # fmt: on

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						do_lower_case=_SCREAMING_SNAKE_CASE   ,						split_by_punct=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )

           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[int] ):






           """simple docstring"""




           UpperCamelCase					       =  self.get_tokenizer()
           UpperCamelCase					       =  self.get_rust_tokenizer()

           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'

           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE ) )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  self.get_rust_tokenizer()
           UpperCamelCase					       =  tokenizer.encode(_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.encode(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Optional[int] ):






           """simple docstring"""




           UpperCamelCase					       =  'This is a test'
           UpperCamelCase					       =  [13, 1, 4398, 25, 21, 1289]
           UpperCamelCase					       =  ['▁', 'T', 'his', '▁is', '▁a', '▁test']
           UpperCamelCase					       =  ['▁', '<unk>', 'his', '▁is', '▁a', '▁test']

           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE   ,						keep_accents=_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  DebertaVaTokenizerFast(_SCREAMING_SNAKE_CASE   ,						keep_accents=_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.tokenize(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.tokenize(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           # fmt: off
           UpperCamelCase					       =  'I was born in 92000, and this is falsé.'
           UpperCamelCase					       =  [13, 1, 23, 386, 19, 561, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]
           UpperCamelCase					       =  ['▁', 'I', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', 'é', '.', ]
           UpperCamelCase					       =  ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '.', ]
           # fmt: on

           UpperCamelCase					       =  tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.tokenize(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.convert_ids_to_tokens(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  rust_tokenizer.encode(_SCREAMING_SNAKE_CASE   ,						add_special_tokens=_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.tokenize(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  rust_tokenizer.convert_ids_to_tokens(_SCREAMING_SNAKE_CASE )
           self.assertListEqual(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )







     def   _SCREAMING_SNAKE_CASE     ( self      :    Any ):






           """simple docstring"""




           UpperCamelCase					       =  DebertaVaTokenizer(_SCREAMING_SNAKE_CASE )

           UpperCamelCase					       =  tokenizer.encode('sequence builders' )
           UpperCamelCase					       =  tokenizer.encode('multi-sequence build' )

           UpperCamelCase					       =  tokenizer.build_inputs_with_special_tokens(_SCREAMING_SNAKE_CASE )
           UpperCamelCase					       =  tokenizer.build_inputs_with_special_tokens(_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE )

           self.assertEqual([tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]   ,						_SCREAMING_SNAKE_CASE )
           self.assertEqual(
               [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [tokenizer.sep_token_id]   ,						_SCREAMING_SNAKE_CASE   ,						)







     @slow
     def   _SCREAMING_SNAKE_CASE     ( self      :    List[Any] ):






           """simple docstring"""




           UpperCamelCase					       =  {'input_ids': [[1, 3_9867, 36, 1_9390, 486, 27, 3_5052, 8_1436, 18, 6_0685, 1225, 7, 3_5052, 8_1436, 18, 9367, 1_6899, 18, 1_5937, 53, 594, 773, 18, 1_6287, 3_0465, 36, 1_5937, 6, 4_1139, 38, 3_6979, 6_0763, 191, 6, 3_4132, 99, 6, 5_0538, 390, 4_3230, 6, 3_4132, 2779, 2_0850, 14, 699, 1072, 1194, 36, 382, 1_0901, 53, 7, 699, 1072, 2084, 36, 2_0422, 630, 53, 19, 105, 3049, 1896, 1053, 1_6899, 1506, 11, 3_7978, 4243, 7, 1237, 3_1869, 200, 1_6566, 654, 6, 3_5052, 8_1436, 7, 5_5630, 1_3593, 4, 2], [1, 26, 1_5011, 13, 667, 8, 1053, 18, 2_3611, 1237, 7_2356, 1_2820, 34, 10_4134, 1209, 35, 1_3313, 6627, 21, 202, 347, 7, 164, 2399, 11, 46, 4485, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 5, 1232, 2864, 1_5785, 1_4951, 105, 5, 8581, 1250, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], 'token_type_ids': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], 'attention_mask': [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}  # noqa: E501
           # fmt: on

           self.tokenizer_integration_test_util(
               expected_encoding=_SCREAMING_SNAKE_CASE   ,						model_name='microsoft/deberta-v2-xlarge'   ,						revision='ad6e42c1532ddf3a15c39246b63f5559d558b670'   ,						)



