"""simple docstring"""
import unittest

from transformers import AutoTokenizer, FalconConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
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 (
     FalconForCausalLM,
     FalconForQuestionAnswering,
     FalconForSequenceClassification,
     FalconForTokenClassification,
     FalconModel,
 )




class        __snake_case	:



      def __init__(						self   ,      lowercase   ,      lowercase=3   ,      lowercase=7   ,      lowercase=True   ,      lowercase=True   ,      lowercase=False   ,      lowercase=True   ,      lowercase=99   ,      lowercase=32   ,      lowercase=5   ,      lowercase=4   ,      lowercase=37   ,      lowercase="gelu"   ,      lowercase=0.1   ,      lowercase=0.1   ,      lowercase=5_12   ,      lowercase=16   ,      lowercase=2   ,      lowercase=0.02   ,      lowercase=3   ,      lowercase=4   ,      lowercase=None   ,      )     ->      Union[str, Any]:





        '''simple docstring'''





        a__:					Tuple      							=     parent
        a__:					Optional[Any]      							=     batch_size
        a__:					List[str]      							=     seq_length
        a__:					List[Any]      							=     is_training
        a__:					Optional[int]      							=     use_input_mask
        a__:					Any      							=     use_token_type_ids
        a__:					Union[str, Any]      							=     use_labels
        a__:					Dict      							=     vocab_size
        a__:					List[Any]      							=     hidden_size
        a__:					Optional[int]      							=     num_hidden_layers
        a__:					Optional[int]      							=     num_attention_heads
        a__:					Optional[Any]      							=     intermediate_size
        a__:					Dict      							=     hidden_act
        a__:					List[str]      							=     hidden_dropout_prob
        a__:					List[str]      							=     attention_probs_dropout_prob
        a__:					Any      							=     max_position_embeddings
        a__:					Any      							=     type_vocab_size
        a__:					Optional[Any]      							=     type_sequence_label_size
        a__:					str      							=     initializer_range
        a__:					Optional[int]      							=     num_labels
        a__:					Tuple      							=     num_choices
        a__:					Union[str, Any]      							=     scope



      def   lowerCamelCase_       (						self)     ->      Tuple:





        '''simple docstring'''





        a__:					Tuple      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.vocab_size)

        a__:					Any      							=     None
        if self.use_input_mask:
          a__:					List[Any]      							=     random_attention_mask([self.batch_size, self.seq_length])

        a__:					str      							=     None

        a__:					str      							=     None
        a__:					Any      							=     None
        a__:					Union[str, Any]      							=     None
        if self.use_labels:
          a__:					Optional[int]      							=     ids_tensor([self.batch_size]   ,      self.type_sequence_label_size)
          a__:					str      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.num_labels)
          a__:					Dict      							=     ids_tensor([self.batch_size]   ,      self.num_choices)

        a__:					Tuple      							=     self.get_config()

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



      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        return FalconConfig(
            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   ,      is_decoder=lowercase   ,      initializer_range=self.initializer_range   ,      pad_token_id=1   ,      new_decoder_architecture=lowercase   ,      )



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase)     ->      Union[str, Any]:





        '''simple docstring'''





        a__:					Tuple      							=     FalconModel(config=lowercase)
        model.to(lowercase)
        model.eval()
        a__:					Tuple      							=     model(lowercase   ,      attention_mask=lowercase)
        a__:					List[Any]      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, self.seq_length, self.hidden_size))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      Tuple:





        '''simple docstring'''





        a__:					Tuple      							=     True
        a__:					Any      							=     FalconModel(lowercase)
        model.to(lowercase)
        model.eval()
        a__:					int      							=     model(
            lowercase   ,      attention_mask=lowercase   ,      encoder_hidden_states=lowercase   ,      encoder_attention_mask=lowercase   ,      )
        a__:					Union[str, Any]      							=     model(
            lowercase   ,      attention_mask=lowercase   ,      encoder_hidden_states=lowercase   ,      )
        a__:					str      							=     model(lowercase   ,      attention_mask=lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, self.seq_length, self.hidden_size))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      List[str]:





        '''simple docstring'''





        a__:					Union[str, Any]      							=     FalconForCausalLM(config=lowercase)
        model.to(lowercase)
        model.eval()
        a__:					Tuple      							=     model(lowercase   ,      attention_mask=lowercase   ,      labels=lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.seq_length, self.vocab_size))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      List[str]:





        '''simple docstring'''





        a__:					str      							=     True
        a__:					int      							=     True
        a__:					Union[str, Any]      							=     FalconForCausalLM(config=lowercase)
        model.to(lowercase)
        model.eval()

        # first forward pass
        a__:					str      							=     model(
            lowercase   ,      attention_mask=lowercase   ,      encoder_hidden_states=lowercase   ,      encoder_attention_mask=lowercase   ,      use_cache=lowercase   ,      )
        a__:					Tuple      							=     outputs.past_key_values

        # create hypothetical multiple next token and extent to next_input_ids
        a__:					str      							=     ids_tensor((self.batch_size, 3)   ,      config.vocab_size)
        a__:					List[Any]      							=     ids_tensor((self.batch_size, 3)   ,      vocab_size=2)

        # append to next input_ids and
        a__:					Union[str, Any]      							=     torch.cat([input_ids, next_tokens]   ,      dim=-1)
        a__:					Tuple      							=     torch.cat([input_mask, next_mask]   ,      dim=-1)

        a__:					List[str]      							=     model(
            lowercase   ,      attention_mask=lowercase   ,      encoder_hidden_states=lowercase   ,      encoder_attention_mask=lowercase   ,      output_hidden_states=lowercase   ,      )['hidden_states'][0]
        a__:					int      							=     model(
            lowercase   ,      attention_mask=lowercase   ,      encoder_hidden_states=lowercase   ,      encoder_attention_mask=lowercase   ,      past_key_values=lowercase   ,      output_hidden_states=lowercase   ,      )['hidden_states'][0]

        # select random slice
        a__:					int      							=     ids_tensor((1,)   ,      output_from_past.shape[-1]).item()
        a__:					Union[str, Any]      							=     output_from_no_past[:, -3:, random_slice_idx].detach()
        a__:					Optional[Any]      							=     output_from_past[:, :, random_slice_idx].detach()

        self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1])

        # test that outputs are equal for slice
        self.parent.assertTrue(torch.allclose(lowercase   ,      lowercase   ,      atol=1e-3))



      def   lowerCamelCase_       (						self)     ->      str:





        '''simple docstring'''





        a__:					Tuple      							=     self.prepare_config_and_inputs()
        (
            (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   
        ):					Union[str, Any]      							=     config_and_inputs
        a__:					int      							=     {'input_ids': input_ids, 'attention_mask': input_mask}
        return config, inputs_dict







@require_torch
class        __snake_case	(					__lowerCAmelCase	,				__lowerCAmelCase	,				__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		(
          (
              FalconModel,
              FalconForCausalLM,
              FalconForSequenceClassification,
              FalconForTokenClassification,
              FalconForQuestionAnswering,
          )
          if is_torch_available()
          else ()
      )
      a__				=		(FalconForCausalLM,) if is_torch_available() else ()
      a__				=		(
          {
              """feature-extraction""": FalconModel,
              """text-classification""": FalconForSequenceClassification,
              """text-generation""": FalconForCausalLM,
              """question-answering""": FalconForQuestionAnswering,
              """token-classification""": FalconForTokenClassification,
              """zero-shot""": FalconForSequenceClassification,
          }
          if is_torch_available()
          else {}
      )
      a__				=		False
      a__				=		False



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__:					int      							=     FalconModelTester(self)
        a__:					int      							=     ConfigTester(self   ,      config_class=lowercase   ,      hidden_size=37)



      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        self.config_tester.run_common_tests()



      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        a__:					Any      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        a__							,   *a__:					str      							=     self.model_tester.prepare_config_and_inputs()
        for alibi in [True, False]:
          a__:					Dict      							=     alibi
          self.model_tester.create_and_check_model(lowercase   ,      *lowercase)



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__							,   a__:					Tuple      							=     self.model_tester.prepare_config_and_inputs_for_common()
        a__:					Tuple      							=     3
        a__:					Tuple      							=     input_dict['input_ids']
        a__:					Optional[int]      							=     input_ids.ne(1).to(lowercase)
        a__:					Tuple      							=     ids_tensor([self.model_tester.batch_size]   ,      self.model_tester.type_sequence_label_size)
        a__:					Tuple      							=     FalconForSequenceClassification(lowercase)
        model.to(lowercase)
        model.eval()
        a__:					Dict      							=     model(lowercase   ,      attention_mask=lowercase   ,      labels=lowercase)
        self.assertEqual(result.logits.shape   ,      (self.model_tester.batch_size, self.model_tester.num_labels))



      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        a__							,   a__:					List[str]      							=     self.model_tester.prepare_config_and_inputs_for_common()
        a__:					Optional[Any]      							=     3
        a__:					Dict      							=     'single_label_classification'
        a__:					int      							=     input_dict['input_ids']
        a__:					Dict      							=     input_ids.ne(1).to(lowercase)
        a__:					Any      							=     ids_tensor([self.model_tester.batch_size]   ,      self.model_tester.type_sequence_label_size)
        a__:					Union[str, Any]      							=     FalconForSequenceClassification(lowercase)
        model.to(lowercase)
        model.eval()
        a__:					Optional[int]      							=     model(lowercase   ,      attention_mask=lowercase   ,      labels=lowercase)
        self.assertEqual(result.logits.shape   ,      (self.model_tester.batch_size, self.model_tester.num_labels))



      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        a__							,   a__:					Any      							=     self.model_tester.prepare_config_and_inputs_for_common()
        a__:					Optional[Any]      							=     input_dict['input_ids']
        a__:					Tuple      							=     FalconForCausalLM(lowercase)
        model.to(lowercase)
        model.eval()
        a__:					List[Any]      							=     model(lowercase   ,      use_cache=lowercase)
        a__:					Union[str, Any]      							=     input_ids.shape[0]
        a__:					List[str]      							=     model._convert_to_rw_cache(result.past_key_values)
        a__:					List[str]      							=     model._convert_cache_to_standard_format(lowercase   ,      lowercase)
        for layer in range(len(lowercase)):
          for tensor_idx in range(2):
            self.assertTrue(rw_cache[layer][tensor_idx].ndim == 3)
            self.assertTrue(result.past_key_values[layer][tensor_idx].ndim == 4)
            self.assertTrue(
                torch.all(result.past_key_values[layer][tensor_idx] == standard_cache[layer][tensor_idx]))



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__							,   a__:					Dict      							=     self.model_tester.prepare_config_and_inputs_for_common()
        a__:					Optional[Any]      							=     3
        a__:					int      							=     'multi_label_classification'
        a__:					Dict      							=     input_dict['input_ids']
        a__:					Tuple      							=     input_ids.ne(1).to(lowercase)
        a__:					Tuple      							=     ids_tensor(
            [self.model_tester.batch_size, config.num_labels]   ,      self.model_tester.type_sequence_label_size).to(torch.float)
        a__:					Optional[int]      							=     FalconForSequenceClassification(lowercase)
        model.to(lowercase)
        model.eval()
        a__:					int      							=     model(lowercase   ,      attention_mask=lowercase   ,      labels=lowercase)
        self.assertEqual(result.logits.shape   ,      (self.model_tester.batch_size, self.model_tester.num_labels))



      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        for model_class in self.all_generative_model_classes:
          a__							,   a__:					Union[str, Any]      							=     self.model_tester.prepare_config_and_inputs_for_common()

          # If it doesn't support cache, pass the test
          if not hasattr(lowercase   ,      'use_cache'):
            return

          a__:					Dict      							=     model_class(lowercase).to(lowercase)
          if "use_cache" not in inputs:
            a__:					Any      							=     True
          a__:					str      							=     model(**lowercase)

          # If "past_key_values" is not returned, pass the test (e.g. RWKV uses a different cache name and format)
          if "past_key_values" not in outputs:
            return

          a__:					Any      							=     (
              getattr(lowercase   ,      'decoder_layers'   ,      lowercase)
              or getattr(lowercase   ,      'num_decoder_layers'   ,      lowercase)
              or config.num_hidden_layers
          )
          a__:					Dict      							=     getattr(lowercase   ,      'num_kv_heads'   ,      config.num_attention_heads)
          a__:					Optional[Any]      							=     getattr(lowercase   ,      'd_model'   ,      config.hidden_size)
          a__:					Optional[int]      							=     embed_dim // num_attention_heads

          a__:					Dict      							=     outputs['past_key_values']
          self.assertEqual(len(lowercase)   ,      lowercase)

          a__							,   a__:					Any      							=     inputs['input_ids'].shape
          for i in range(lowercase):
            if config.new_decoder_architecture:
              a__:					Any      							=     config.num_attention_heads
            elif config.multi_query:
              a__:					Tuple      							=     1
            self.assertEqual(len(past_kv[0])   ,      2)  # K V for the decoder = 2
            self.assertEqual(
                past_kv[i][0].shape   ,      (batch_size, num_attention_heads, seq_length, per_head_embed_dim))
            self.assertEqual(
                past_kv[i][1].shape   ,      (batch_size, num_attention_heads, seq_length, per_head_embed_dim))







@require_torch
class        __snake_case	(					unittest.TestCase    ):



      @slow
      def   lowerCamelCase_       (						self)     ->      Dict:





        '''simple docstring'''





        a__:					Dict      							=     AutoTokenizer.from_pretrained('Rocketknight1/falcon-rw-1b')
        a__:					Union[str, Any]      							=     FalconForCausalLM.from_pretrained('Rocketknight1/falcon-rw-1b')
        model.eval()
        model.to(lowercase)
        a__:					Optional[Any]      							=     tokenizer('My favorite food is'   ,      return_tensors='pt').to(lowercase)

        a__:					int      							=     (
            'My favorite food is pizza. I love it so much that I have a pizza party every year for my birthday.'
        )

        a__:					List[Any]      							=     model.generate(**lowercase   ,      do_sample=lowercase   ,      max_new_tokens=19)
        a__:					Optional[int]      							=     tokenizer.batch_decode(lowercase)[0]

        self.assertEqual(lowercase   ,      lowercase)



      @slow
      def   lowerCamelCase_       (						self)     ->      str:





        '''simple docstring'''





        for repo in ["Rocketknight1/tiny-random-falcon-7b", "Rocketknight1/tiny-random-falcon-40b"]:
          a__:					Optional[int]      							=     AutoTokenizer.from_pretrained(lowercase)
          a__:					Optional[int]      							=     FalconForCausalLM.from_pretrained(lowercase)
          model.eval()
          model.to(lowercase)
          a__:					str      							=     tokenizer('My favorite food is'   ,      return_tensors='pt').to(lowercase)

          # We just test that these run without errors - the models are randomly initialized
          # and so the actual text outputs will be garbage
          model.generate(**lowercase   ,      do_sample=lowercase   ,      max_new_tokens=4)
          model.generate(**lowercase   ,      do_sample=lowercase   ,      max_new_tokens=4)
          model.generate(**lowercase   ,      num_beams=2   ,      max_new_tokens=4)



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





        '''simple docstring'''





        with torch.no_grad():
          for repo in [
              "Rocketknight1/falcon-rw-1b",
              "Rocketknight1/tiny-random-falcon-7b",
              "Rocketknight1/tiny-random-falcon-40b",
          ]:
            a__:					int      							=     AutoTokenizer.from_pretrained(lowercase)
            a__:					List[str]      							=     FalconForCausalLM.from_pretrained(lowercase)
            model.eval()
            model.to(device=lowercase)
            a__:					Optional[Any]      							=     tokenizer('My favorite food is'   ,      return_tensors='pt').to(lowercase)

            # Test results are the same with and without cache
            a__:					List[Any]      							=     model.generate(**lowercase   ,      do_sample=lowercase   ,      max_new_tokens=20   ,      use_cache=lowercase)
            a__:					Any      							=     model.generate(**lowercase   ,      do_sample=lowercase   ,      max_new_tokens=20   ,      use_cache=lowercase)
            self.assertTrue((outputs_cache - outputs_no_cache).sum().item() == 0)



"""simple docstring"""
from __future__ import annotations

import unittest

import numpy as np

from transformers import BlipTextConfig
from transformers.testing_utils import require_tf, slow
from transformers.utils import is_tf_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask


if is_tf_available():
 import tensorflow as tf

 from transformers import TFBlipTextModel
 from transformers.models.blip.modeling_tf_blip import TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST




class        __snake_case	:



      def __init__(						self   ,      lowercase   ,      lowercase=12   ,      lowercase=7   ,      lowercase=True   ,      lowercase=True   ,      lowercase=True   ,      lowercase=99   ,      lowercase=32   ,      lowercase=32   ,      lowercase=2   ,      lowercase=4   ,      lowercase=37   ,      lowercase=0.1   ,      lowercase=0.1   ,      lowercase=5_12   ,      lowercase=0.02   ,      lowercase=0   ,      lowercase=None   ,      )     ->      Optional[int]:





        '''simple docstring'''





        a__:					List[Any]      							=     parent
        a__:					Any      							=     batch_size
        a__:					int      							=     seq_length
        a__:					List[str]      							=     is_training
        a__:					Any      							=     use_input_mask
        a__:					Optional[Any]      							=     use_labels
        a__:					List[Any]      							=     vocab_size
        a__:					Optional[Any]      							=     hidden_size
        a__:					Any      							=     projection_dim
        a__:					List[str]      							=     num_hidden_layers
        a__:					Dict      							=     num_attention_heads
        a__:					int      							=     intermediate_size
        a__:					Tuple      							=     dropout
        a__:					Union[str, Any]      							=     attention_dropout
        a__:					str      							=     max_position_embeddings
        a__:					List[str]      							=     initializer_range
        a__:					Optional[int]      							=     scope
        a__:					List[Any]      							=     bos_token_id



      def   lowerCamelCase_       (						self)     ->      Dict:





        '''simple docstring'''





        a__:					str      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.vocab_size)

        a__:					str      							=     None
        if self.use_input_mask:
          a__:					List[str]      							=     random_attention_mask([self.batch_size, self.seq_length])

        if input_mask is not None:
          a__:					str      							=     input_mask.numpy()
          a__							,   a__:					Any      							=     input_mask.shape
          a__:					Tuple      							=     np.random.randint(1   ,      seq_length - 1   ,      size=(batch_size,))
          for batch_idx, start_index in enumerate(lowercase):
            a__:					Tuple      							=     1
            a__:					Any      							=     0

        a__:					Any      							=     self.get_config()

        return config, input_ids, tf.convert_to_tensor(lowercase)



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





        '''simple docstring'''





        return BlipTextConfig(
            vocab_size=self.vocab_size   ,      hidden_size=self.hidden_size   ,      projection_dim=self.projection_dim   ,      num_hidden_layers=self.num_hidden_layers   ,      num_attention_heads=self.num_attention_heads   ,      intermediate_size=self.intermediate_size   ,      dropout=self.dropout   ,      attention_dropout=self.attention_dropout   ,      max_position_embeddings=self.max_position_embeddings   ,      initializer_range=self.initializer_range   ,      bos_token_id=self.bos_token_id   ,      )



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase)     ->      List[Any]:





        '''simple docstring'''





        a__:					Any      							=     TFBlipTextModel(config=lowercase)
        a__:					Union[str, Any]      							=     model(lowercase   ,      attention_mask=lowercase   ,      training=lowercase)
        a__:					List[Any]      							=     model(lowercase   ,      training=lowercase)
        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   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        a__:					Tuple      							=     self.prepare_config_and_inputs()
        a__							,   a__							,   a__:					Optional[Any]      							=     config_and_inputs
        a__:					Dict      							=     {'input_ids': input_ids, 'attention_mask': input_mask}
        return config, inputs_dict







@require_tf
class        __snake_case	(					__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		(TFBlipTextModel,) if is_tf_available() else ()
      a__				=		False
      a__				=		False
      a__				=		False



      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        a__:					List[Any]      							=     BlipTextModelTester(self)
        a__:					int      							=     ConfigTester(self   ,      config_class=lowercase   ,      hidden_size=37)



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        self.config_tester.run_common_tests()



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





        '''simple docstring'''





        a__:					List[str]      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Dict:





        '''simple docstring'''





        pass



      def   lowerCamelCase_       (						self)     ->      List[str]:





        '''simple docstring'''





        pass



      @unittest.skip(reason='Blip does not use inputs_embeds')
      def   lowerCamelCase_       (						self)     ->      List[str]:





        '''simple docstring'''





        pass



      @unittest.skip(reason='BlipTextModel has no base class and is not available in MODEL_MAPPING')
      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        pass



      @unittest.skip(reason='BlipTextModel has no base class and is not available in MODEL_MAPPING')
      def   lowerCamelCase_       (						self)     ->      Tuple:





        '''simple docstring'''





        pass



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





        '''simple docstring'''





        for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
          a__:					Tuple      							=     TFBlipTextModel.from_pretrained(lowercase)
          self.assertIsNotNone(lowercase)



      def   lowerCamelCase_       (						self   ,      lowercase=True)     ->      str:





        '''simple docstring'''





        super().test_pt_tf_model_equivalence(allow_missing_keys=lowercase)


