


import os
import sys
import unittest


snake_case							:	str					      =				os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, '''utils'''))

import get_test_info  # noqa: E402
from get_test_info import (  # noqa: E402
    get_model_to_test_mapping,
    get_model_to_tester_mapping,
    get_test_to_tester_mapping,
)


snake_case							:	Optional[int]					      =				os.path.join('''tests''', '''models''', '''bert''', '''test_modeling_bert.py''')
snake_case							:	List[str]					      =				os.path.join('''tests''', '''models''', '''blip''', '''test_modeling_blip.py''')







class 	snake_case_       (unittest.TestCase				):
					def 			lowerCamelCase__(				self       :List[str]				) ->   str:
												a__					=					get_test_to_tester_mapping(__snake_case				)
												a__					=					get_test_to_tester_mapping(__snake_case				)

												a__					=					{'BertModelTest': 'BertModelTester'}

												a__					=					{
												    'BlipModelTest': 'BlipModelTester',
												    'BlipTextImageModelTest': 'BlipTextImageModelsModelTester',
												    'BlipTextModelTest': 'BlipTextModelTester',
												    'BlipTextRetrievalModelTest': 'BlipTextRetrievalModelTester',
												    'BlipVQAModelTest': 'BlipVQAModelTester',
												    'BlipVisionModelTest': 'BlipVisionModelTester',
												}

												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)
												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)
					def 			lowerCamelCase__(				self       :int				) ->   Tuple:
												a__					=					get_model_to_test_mapping(__snake_case				)
												a__					=					get_model_to_test_mapping(__snake_case				)

												a__					=					{
												    'BertForMaskedLM': ['BertModelTest'],
												    'BertForMultipleChoice': ['BertModelTest'],
												    'BertForNextSentencePrediction': ['BertModelTest'],
												    'BertForPreTraining': ['BertModelTest'],
												    'BertForQuestionAnswering': ['BertModelTest'],
												    'BertForSequenceClassification': ['BertModelTest'],
												    'BertForTokenClassification': ['BertModelTest'],
												    'BertLMHeadModel': ['BertModelTest'],
												    'BertModel': ['BertModelTest'],
												}

												a__					=					{
												    'BlipForConditionalGeneration': ['BlipTextImageModelTest'],
												    'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTest'],
												    'BlipForQuestionAnswering': ['BlipVQAModelTest'],
												    'BlipModel': ['BlipModelTest'],
												    'BlipTextModel': ['BlipTextModelTest'],
												    'BlipVisionModel': ['BlipVisionModelTest'],
												}

												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)
												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)



					def 			lowerCamelCase__(				self       :List[Any]				) ->   Optional[int]:
												a__					=					get_model_to_tester_mapping(__snake_case				)
												a__					=					get_model_to_tester_mapping(__snake_case				)

												a__					=					{
												    'BertForMaskedLM': ['BertModelTester'],
												    'BertForMultipleChoice': ['BertModelTester'],
												    'BertForNextSentencePrediction': ['BertModelTester'],
												    'BertForPreTraining': ['BertModelTester'],
												    'BertForQuestionAnswering': ['BertModelTester'],
												    'BertForSequenceClassification': ['BertModelTester'],
												    'BertForTokenClassification': ['BertModelTester'],
												    'BertLMHeadModel': ['BertModelTester'],
												    'BertModel': ['BertModelTester'],
												}

												a__					=					{
												    'BlipForConditionalGeneration': ['BlipTextImageModelsModelTester'],
												    'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTester'],
												    'BlipForQuestionAnswering': ['BlipVQAModelTester'],
												    'BlipModel': ['BlipModelTester'],
												    'BlipTextModel': ['BlipTextModelTester'],
												    'BlipVisionModel': ['BlipVisionModelTester'],
												}

												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)
												self.assertEqual(get_test_info.to_json(__snake_case				)      ,__snake_case				)








from ...configuration_utils import PretrainedConfig
from ...utils import logging


snake_case							:	Optional[int]					      =				logging.get_logger(__name__)

snake_case							:	Union[str, Any]					      =				{
    '''uclanlp/visualbert-vqa''': '''https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json''',
    '''uclanlp/visualbert-vqa-pre''': '''https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json''',
    '''uclanlp/visualbert-vqa-coco-pre''': (
        '''https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json'''
    ),
    '''uclanlp/visualbert-vcr''': '''https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json''',
    '''uclanlp/visualbert-vcr-pre''': '''https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json''',
    '''uclanlp/visualbert-vcr-coco-pre''': (
        '''https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json'''
    ),
    '''uclanlp/visualbert-nlvr2''': '''https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json''',
    '''uclanlp/visualbert-nlvr2-pre''': '''https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json''',
    '''uclanlp/visualbert-nlvr2-coco-pre''': (
        '''https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json'''
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}







class 	snake_case_       (lowerCamelCase_				):
					UpperCAmelCase__ :   Dict   				=      '''visual_bert'''
					def __init__(				self       :Optional[int]      ,__snake_case       :Any=3_05_22      ,__snake_case       :str=7_68      ,__snake_case       :Any=5_12      ,__snake_case       :Any=12      ,__snake_case       :int=12      ,__snake_case       :str=30_72      ,__snake_case       :int="gelu"      ,__snake_case       :Optional[int]=0.1      ,__snake_case       :str=0.1      ,__snake_case       :Union[str, Any]=5_12      ,__snake_case       :Tuple=2      ,__snake_case       :Union[str, Any]=0.02      ,__snake_case       :Optional[Any]=1E-12      ,__snake_case       :Optional[Any]=False      ,__snake_case       :int=True      ,__snake_case       :Any=1      ,__snake_case       :Optional[int]=0      ,__snake_case       :Tuple=2      ,**__snake_case       :Any      ,) ->   Union[str, Any]:
												super().__init__(pad_token_id=__snake_case      ,bos_token_id=__snake_case      ,eos_token_id=__snake_case      ,**__snake_case				)

												a__					=					vocab_size
												a__					=					max_position_embeddings
												a__					=					hidden_size
												a__					=					visual_embedding_dim
												a__					=					num_hidden_layers
												a__					=					num_attention_heads
												a__					=					intermediate_size
												a__					=					hidden_act
												a__					=					hidden_dropout_prob
												a__					=					attention_probs_dropout_prob
												a__					=					initializer_range
												a__					=					type_vocab_size
												a__					=					layer_norm_eps
												a__					=					bypass_transformer
												a__					=					special_visual_initialize




