





import os
import sys
import unittest


snake_case 				=       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 				=       os.path.join("""tests""", """models""", """bert""", """test_modeling_bert.py""")
snake_case 				=       os.path.join("""tests""", """models""", """blip""", """test_modeling_blip.py""")





class 				A_				(      unittest.TestCase	):







       """simple docstring"""





       def    __UpperCAmelCase (    self	:	Optional[int]  )						->					Union[str, Any]:
         _lowercase							= get_test_to_tester_mapping(__A  )
         _lowercase							= get_test_to_tester_mapping(__A  )

         _lowercase							= {'BertModelTest': 'BertModelTester'}

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

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







       def    __UpperCAmelCase (    self	:	int  )						->					Optional[int]:
         _lowercase							= get_model_to_test_mapping(__A  )
         _lowercase							= get_model_to_test_mapping(__A  )

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

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

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







       def    __UpperCAmelCase (    self	:	List[Any]  )						->					Tuple:
         _lowercase							= get_model_to_tester_mapping(__A  )
         _lowercase							= get_model_to_tester_mapping(__A  )

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

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

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






from ....utils import logging


snake_case 				=       logging.get_logger(__name__)





class 				A_				(      UpperCAmelCase	):







       """simple docstring"""





       def __init__(    self	:	Union[str, Any]						,__A	:	int						,__A	:	List[Any]=None						,__A	:	List[str]=2048  )						->					List[Any]:
         _lowercase							= config.__dict__
         _lowercase							= modal_hidden_size
         if num_labels:
           _lowercase							= num_labels