




'''simple docstring'''

import argparse
import re

import requests
import torch

# git clone https://github.com/salesforce/BLIP.git
from models.blip import blip_decoder
from models.blip_itm import blip_itm
from models.blip_vqa import blip_vqa
from PIL import Image
from torchvision import transforms
from torchvision.transforms.functional import InterpolationMode

from transformers import (
    BertTokenizer,
    BlipConfig,
    BlipForConditionalGeneration,
    BlipForImageTextRetrieval,
    BlipForQuestionAnswering,
)


def 						__magic_name__       (      __UpperCAmelCase, __UpperCAmelCase      )						->   str:

					'''simple docstring'''

					snake_case_		     =							'''https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'''
					snake_case_		     =							Image.open(requests.get(__UpperCAmelCase, stream=__UpperCAmelCase      ).raw      ).convert('''RGB'''      )

					snake_case_		     =							transforms.Compose(
					    [
					        transforms.Resize((image_size, image_size), interpolation=InterpolationMode.BICUBIC      ),
					        transforms.ToTensor(),
					        transforms.Normalize((0.4_8_1_4_5_4_6_6, 0.4_5_7_8_2_7_5, 0.4_0_8_2_1_0_7_3), (0.2_6_8_6_2_9_5_4, 0.2_6_1_3_0_2_5_8, 0.2_7_5_7_7_7_1_1)      ),
					    ]      )
					snake_case_		     =							transform(__UpperCAmelCase      ).unsqueeze(0      ).to(__UpperCAmelCase      )
					return image


def 						__magic_name__       (      __UpperCAmelCase      )						->   Union[str, Any]:

					'''simple docstring'''

					if "visual_encoder" in key:
										snake_case_		     =							re.sub('''visual_encoder*''', '''vision_model.encoder''', __UpperCAmelCase      )
					if "blocks" in key:
										snake_case_		     =							re.sub(r'''blocks''', '''layers''', __UpperCAmelCase      )
					if "attn" in key:
										snake_case_		     =							re.sub(r'''attn''', '''self_attn''', __UpperCAmelCase      )
					if "norm1" in key:
										snake_case_		     =							re.sub(r'''norm1''', '''layer_norm1''', __UpperCAmelCase      )
					if "norm2" in key:
										snake_case_		     =							re.sub(r'''norm2''', '''layer_norm2''', __UpperCAmelCase      )
					if "encoder.norm" in key:
										snake_case_		     =							re.sub(r'''encoder.norm''', '''post_layernorm''', __UpperCAmelCase      )
					if "encoder.patch_embed.proj" in key:
										snake_case_		     =							re.sub(r'''encoder.patch_embed.proj''', '''embeddings.patch_embedding''', __UpperCAmelCase      )

					if "encoder.pos_embed" in key:
										snake_case_		     =							re.sub(r'''encoder.pos_embed''', '''embeddings.position_embedding''', __UpperCAmelCase      )
					if "encoder.cls_token" in key:
										snake_case_		     =							re.sub(r'''encoder.cls_token''', '''embeddings.class_embedding''', __UpperCAmelCase      )

					if "self_attn" in key:
										snake_case_		     =							re.sub(r'''self_attn.proj''', '''self_attn.projection''', __UpperCAmelCase      )

					return key


@torch.no_grad()
def 						__magic_name__       (      __UpperCAmelCase, __UpperCAmelCase=None      )						->   int:

					'''simple docstring'''

					if config_path is not None:
										snake_case_		     =							BlipConfig.from_pretrained(__UpperCAmelCase      )
					else:
										snake_case_		     =							BlipConfig(projection_dim=512, text_config={}, vision_config={}      )

					snake_case_		     =							BlipForConditionalGeneration(__UpperCAmelCase      ).eval()

					snake_case_		     =							'''https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_capfilt_large.pth'''

					snake_case_		     =							blip_decoder(pretrained=__UpperCAmelCase, image_size=384, vit='''base'''      )
					snake_case_		     =							pt_model.eval()

					snake_case_		     =							pt_model.state_dict()
					for key in modified_state_dict.copy():
										snake_case_		     =							modified_state_dict.pop(__UpperCAmelCase      )
										snake_case_		     =							rename_key(__UpperCAmelCase      )
										snake_case_		     =							value

					hf_model.load_state_dict(__UpperCAmelCase      )

					snake_case_		     =							384
					snake_case_		     =							load_demo_image(image_size=__UpperCAmelCase, device='''cpu'''      )
					snake_case_		     =							BertTokenizer.from_pretrained('''bert-base-uncased'''      )
					snake_case_		     =							tokenizer(['''a picture of''']      ).input_ids

					snake_case_		     =							hf_model.generate(__UpperCAmelCase, __UpperCAmelCase      )

					assert out[0].tolist() == [3_0522, 1037, 3861, 1997, 1037, 2450, 3564, 2006, 1996, 3509, 2007, 2014, 3899, 102]

					snake_case_		     =							hf_model.generate(__UpperCAmelCase      )

					assert out[0].tolist() == [3_0522, 1037, 2450, 3564, 2006, 1996, 3509, 2007, 2014, 3899, 102]

					if pytorch_dump_folder_path is not None:
										hf_model.save_pretrained(__UpperCAmelCase      )

					# model_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_vqa.pth'
					snake_case_		     =							(
					    '''https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_vqa_capfilt_large.pth'''
					)

					snake_case_		     =							blip_vqa(pretrained=__UpperCAmelCase, image_size=__UpperCAmelCase, vit='''base'''      )
					vqa_model.eval()

					snake_case_		     =							vqa_model.state_dict()
					for key in modified_state_dict.copy():
										snake_case_		     =							modified_state_dict.pop(__UpperCAmelCase      )
										snake_case_		     =							rename_key(__UpperCAmelCase      )
										snake_case_		     =							value

					snake_case_		     =							BlipForQuestionAnswering(__UpperCAmelCase      )

					hf_vqa_model.load_state_dict(__UpperCAmelCase      )

					snake_case_		     =							['''How many dogs are in this image?''']
					snake_case_		     =							tokenizer(__UpperCAmelCase, return_tensors='''pt'''      ).input_ids

					snake_case_		     =							hf_vqa_model.generate(__UpperCAmelCase, __UpperCAmelCase      )
					print(tokenizer.decode(answer[0]      )      )

					assert tokenizer.decode(answer[0]      ) == "[UNK] 1 [SEP]"
					if pytorch_dump_folder_path is not None:
										hf_vqa_model.save_pretrained(pytorch_dump_folder_path + '''_vqa'''      )

					snake_case_		     =							'''https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_retrieval_coco.pth'''

					snake_case_		     =							blip_itm(pretrained=__UpperCAmelCase, image_size=__UpperCAmelCase, vit='''base'''      )
					itm_model.eval()

					snake_case_		     =							itm_model.state_dict()
					for key in modified_state_dict.copy():
										snake_case_		     =							modified_state_dict.pop(__UpperCAmelCase      )
										snake_case_		     =							rename_key(__UpperCAmelCase      )
										snake_case_		     =							value

					snake_case_		     =							BlipForImageTextRetrieval(__UpperCAmelCase      )

					snake_case_		     =							['''A picture of a woman with a dog sitting in a beach''']
					snake_case_		     =							tokenizer(
					    __UpperCAmelCase, return_tensors='''pt''', padding='''max_length''', truncation=__UpperCAmelCase, max_length=35, ).input_ids

					hf_itm_model.load_state_dict(__UpperCAmelCase      )
					hf_itm_model.eval()

					snake_case_		     =							hf_itm_model(__UpperCAmelCase, __UpperCAmelCase, use_itm_head=__UpperCAmelCase      )
					snake_case_		     =							hf_itm_model(__UpperCAmelCase, __UpperCAmelCase, use_itm_head=__UpperCAmelCase      )

					assert out[0].item() == 0.2_1_1_0_6_8_7_4_9_4_2_7_7_9_5_4
					assert torch.nn.functional.softmax(out_itm[0], dim=1      )[:, 1].item() == 0.4_5_6_9_8_8_4_5_3_8_6_5_0_5_1_2_7

					if pytorch_dump_folder_path is not None:
										hf_itm_model.save_pretrained(pytorch_dump_folder_path + '''_itm'''      )


if __name__ == "__main__":
							a    :							Tuple										=    argparse.ArgumentParser()
							parser.add_argument('--pytorch_dump_folder_path', default=None, type=str, help='Path to the output PyTorch model.')
							parser.add_argument('--config_path', default=None, type=str, help='Path to hf config.json of model to convert')
							a    :							Tuple										=    parser.parse_args()

							convert_blip_checkpoint(args.checkpoint_path, args.pytorch_dump_folder_path, args.config_path)







'''simple docstring'''

from __future__ import annotations

import unittest

from transformers import FunnelConfig, is_tf_available
from transformers.testing_utils import require_tf

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


if is_tf_available():
							import tensorflow as tf

							from transformers import (
							    TFFunnelBaseModel,
							    TFFunnelForMaskedLM,
							    TFFunnelForMultipleChoice,
							    TFFunnelForPreTraining,
							    TFFunnelForQuestionAnswering,
							    TFFunnelForSequenceClassification,
							    TFFunnelForTokenClassification,
							    TFFunnelModel,
							)






class 		a							:


				def __init__(						self       :   Dict			,							lowercase_       :   str			,							lowercase_       :   Union[str, Any]=13			,							lowercase_       :   Union[str, Any]=7			,							lowercase_       :   Tuple=True			,							lowercase_       :   int=True			,							lowercase_       :   Dict=True			,							lowercase_       :   Any=True			,							lowercase_       :   Union[str, Any]=99			,							lowercase_       :   Tuple=[1, 1, 2]			,							lowercase_       :   List[Any]=1			,							lowercase_       :   int=32			,							lowercase_       :   List[Any]=4			,							lowercase_       :   Tuple=8			,							lowercase_       :   Union[str, Any]=37			,							lowercase_       :   Union[str, Any]="gelu_new"			,							lowercase_       :   str=0.1			,							lowercase_       :   Tuple=0.1			,							lowercase_       :   Optional[int]=0.0			,							lowercase_       :   Optional[int]=512			,							lowercase_       :   int=3			,							lowercase_       :   Dict=0.02			,							lowercase_       :   Union[str, Any]=3			,							lowercase_       :   Dict=4			,							lowercase_       :   List[str]=None			,							lowercase_       :   Tuple=False			,							):
									snake_case_		     =							parent
									snake_case_		     =							batch_size
									snake_case_		     =							seq_length
									snake_case_		     =							is_training
									snake_case_		     =							use_input_mask
									snake_case_		     =							use_token_type_ids
									snake_case_		     =							use_labels
									snake_case_		     =							vocab_size
									snake_case_		     =							block_sizes
									snake_case_		     =							num_decoder_layers
									snake_case_		     =							d_model
									snake_case_		     =							n_head
									snake_case_		     =							d_head
									snake_case_		     =							d_inner
									snake_case_		     =							hidden_act
									snake_case_		     =							hidden_dropout
									snake_case_		     =							attention_dropout
									snake_case_		     =							activation_dropout
									snake_case_		     =							max_position_embeddings
									snake_case_		     =							type_vocab_size
									snake_case_		     =							2
									snake_case_		     =							num_labels
									snake_case_		     =							num_choices
									snake_case_		     =							scope
									snake_case_		     =							initializer_std

									# Used in the tests to check the size of the first attention layer
									snake_case_		     =							n_head
									# Used in the tests to check the size of the first hidden state
									snake_case_		     =							self.d_model
									# Used in the tests to check the number of output hidden states/attentions
									snake_case_		     =							sum(self.block_sizes   ) + (0 if base else self.num_decoder_layers)
									# FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
									# the last hidden state of the first block (which is the first hidden state of the decoder).
									if not base:
														snake_case_		     =							self.num_hidden_layers + 2


				def     A_					(						self       :   Union[str, Any]   ):
									snake_case_		     =							ids_tensor([self.batch_size, self.seq_length]			,							self.vocab_size   )

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

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

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

									snake_case_		     =							FunnelConfig(
									    vocab_size=self.vocab_size			,							block_sizes=self.block_sizes			,							num_decoder_layers=self.num_decoder_layers			,							d_model=self.d_model			,							n_head=self.n_head			,							d_head=self.d_head			,							d_inner=self.d_inner			,							hidden_act=self.hidden_act			,							hidden_dropout=self.hidden_dropout			,							attention_dropout=self.attention_dropout			,							activation_dropout=self.activation_dropout			,							max_position_embeddings=self.max_position_embeddings			,							type_vocab_size=self.type_vocab_size			,							initializer_std=self.initializer_std			,							)

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


				def     A_					(						self       :   Optional[Any]			,							lowercase_       :   int			,							lowercase_       :   Tuple			,							lowercase_       :   List[str]			,							lowercase_       :   Union[str, Any]			,							lowercase_       :   Optional[int]			,							lowercase_       :   List[Any]			,							lowercase_       :   Optional[int]			,							):
									snake_case_		     =							TFFunnelModel(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )

									snake_case_		     =							[input_ids, input_mask]
									snake_case_		     =							model(lowercase_   )

									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, self.seq_length, self.d_model)   )

									snake_case_		     =							False
									snake_case_		     =							TFFunnelModel(config=lowercase_   )
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, self.seq_length, self.d_model)   )

									snake_case_		     =							False
									snake_case_		     =							TFFunnelModel(config=lowercase_   )
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, self.seq_length, self.d_model)   )


				def     A_					(						self       :   List[Any]			,							lowercase_       :   Tuple			,							lowercase_       :   Dict			,							lowercase_       :   List[Any]			,							lowercase_       :   Dict			,							lowercase_       :   int			,							lowercase_       :   int			,							lowercase_       :   List[Any]			,							):
									snake_case_		     =							TFFunnelBaseModel(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )

									snake_case_		     =							[input_ids, input_mask]
									snake_case_		     =							model(lowercase_   )

									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, 2, self.d_model)   )

									snake_case_		     =							False
									snake_case_		     =							TFFunnelBaseModel(config=lowercase_   )
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, 3, self.d_model)   )

									snake_case_		     =							False
									snake_case_		     =							TFFunnelBaseModel(config=lowercase_   )
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, 2, self.d_model)   )


				def     A_					(						self       :   Any			,							lowercase_       :   Optional[int]			,							lowercase_       :   str			,							lowercase_       :   int			,							lowercase_       :   Optional[int]			,							lowercase_       :   Optional[int]			,							lowercase_       :   Dict			,							lowercase_       :   Union[str, Any]			,							):
									snake_case_		     =							TFFunnelForPreTraining(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.seq_length)   )


				def     A_					(						self       :   Any			,							lowercase_       :   Union[str, Any]			,							lowercase_       :   Tuple			,							lowercase_       :   str			,							lowercase_       :   Tuple			,							lowercase_       :   List[str]			,							lowercase_       :   Union[str, Any]			,							lowercase_       :   Union[str, Any]			,							):
									snake_case_		     =							TFFunnelForMaskedLM(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.seq_length, self.vocab_size)   )


				def     A_					(						self       :   Dict			,							lowercase_       :   Dict			,							lowercase_       :   str			,							lowercase_       :   Optional[Any]			,							lowercase_       :   Tuple			,							lowercase_       :   Optional[Any]			,							lowercase_       :   Tuple			,							lowercase_       :   Tuple			,							):
									snake_case_		     =							self.num_labels
									snake_case_		     =							TFFunnelForSequenceClassification(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.num_labels)   )


				def     A_					(						self       :   int			,							lowercase_       :   Optional[int]			,							lowercase_       :   Any			,							lowercase_       :   List[str]			,							lowercase_       :   Optional[int]			,							lowercase_       :   str			,							lowercase_       :   str			,							lowercase_       :   int			,							):
									snake_case_		     =							self.num_choices
									snake_case_		     =							TFFunnelForMultipleChoice(config=lowercase_   )
									snake_case_		     =							tf.tile(tf.expand_dims(lowercase_			,							1   )			,							(1, self.num_choices, 1)   )
									snake_case_		     =							tf.tile(tf.expand_dims(lowercase_			,							1   )			,							(1, self.num_choices, 1)   )
									snake_case_		     =							tf.tile(tf.expand_dims(lowercase_			,							1   )			,							(1, self.num_choices, 1)   )
									snake_case_		     =							{
									    '''input_ids''': multiple_choice_inputs_ids,
									    '''attention_mask''': multiple_choice_input_mask,
									    '''token_type_ids''': multiple_choice_token_type_ids,
									}
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.num_choices)   )


				def     A_					(						self       :   Any			,							lowercase_       :   str			,							lowercase_       :   Dict			,							lowercase_       :   int			,							lowercase_       :   Optional[int]			,							lowercase_       :   List[str]			,							lowercase_       :   Any			,							lowercase_       :   Optional[Any]			,							):
									snake_case_		     =							self.num_labels
									snake_case_		     =							TFFunnelForTokenClassification(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )
									self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.seq_length, self.num_labels)   )


				def     A_					(						self       :   Optional[Any]			,							lowercase_       :   Any			,							lowercase_       :   Dict			,							lowercase_       :   Any			,							lowercase_       :   int			,							lowercase_       :   Tuple			,							lowercase_       :   List[str]			,							lowercase_       :   Optional[Any]			,							):
									snake_case_		     =							TFFunnelForQuestionAnswering(config=lowercase_   )
									snake_case_		     =							{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
									snake_case_		     =							model(lowercase_   )
									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     A_					(						self       :   Any   ):
									snake_case_		     =							self.prepare_config_and_inputs()
									(
									    (
									    snake_case_
									)     ,(
									    snake_case_
									)     ,(
									    snake_case_
									)     ,(
									    snake_case_
									)     ,(
									    snake_case_
									)     ,(
									    snake_case_
									)     ,(
									    snake_case_
									)     ,
									)		     =							config_and_inputs
									snake_case_		     =							{'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
									return config, inputs_dict







@require_tf
class 		a							(  _lowerCamelCase  ,	_lowerCamelCase  ,	unittest.TestCase	):
				snake_case_           =						(
				    (
				        TFFunnelModel,
				        TFFunnelForMaskedLM,
				        TFFunnelForPreTraining,
				        TFFunnelForQuestionAnswering,
				        TFFunnelForTokenClassification,
				    )
				    if is_tf_available()
				    else ()
				)
				snake_case_           =						(
				    {
				        "feature-extraction": (TFFunnelBaseModel, TFFunnelModel),
				        "fill-mask": TFFunnelForMaskedLM,
				        "question-answering": TFFunnelForQuestionAnswering,
				        "text-classification": TFFunnelForSequenceClassification,
				        "token-classification": TFFunnelForTokenClassification,
				        "zero-shot": TFFunnelForSequenceClassification,
				    }
				    if is_tf_available()
				    else {}
				)
				snake_case_           =						False
				snake_case_           =						False


				def     A_					(						self       :   int   ):
									snake_case_		     =							TFFunnelModelTester(self   )
									snake_case_		     =							ConfigTester(self			,							config_class=lowercase_   )


				def     A_					(						self       :   Union[str, Any]   ):
									self.config_tester.run_common_tests()


				def     A_					(						self       :   List[Any]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*lowercase_   )


				def     A_					(						self       :   List[str]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_pretraining(*lowercase_   )


				def     A_					(						self       :   str   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_masked_lm(*lowercase_   )


				def     A_					(						self       :   List[str]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_token_classification(*lowercase_   )


				def     A_					(						self       :   List[Any]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_question_answering(*lowercase_   )







@require_tf
class 		a							(  _lowerCamelCase  ,	unittest.TestCase	):
				snake_case_           =						(
				    (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
				)
				snake_case_           =						False
				snake_case_           =						False


				def     A_					(						self       :   Union[str, Any]   ):
									snake_case_		     =							TFFunnelModelTester(self			,							base=lowercase_   )
									snake_case_		     =							ConfigTester(self			,							config_class=lowercase_   )


				def     A_					(						self       :   Dict   ):
									self.config_tester.run_common_tests()


				def     A_					(						self       :   List[str]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_base_model(*lowercase_   )


				def     A_					(						self       :   Union[str, Any]   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_sequence_classification(*lowercase_   )


				def     A_					(						self       :   str   ):
									snake_case_		     =							self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_multiple_choice(*lowercase_   )

