






import os
import sys

__a:     Union[str, Any]   					=					os.path.join(os.path.dirname(__file__), '''src''')
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__a:     Union[str, Any]   					=					[
    '''torch''',
    '''numpy''',
    '''tokenizers''',
    '''filelock''',
    '''requests''',
    '''tqdm''',
    '''regex''',
    '''sentencepiece''',
    '''sacremoses''',
    '''importlib_metadata''',
    '''huggingface_hub''',
]




@add_start_docstrings(AutoConfig.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Union[str, Any]:
       return AutoConfig.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoTokenizer.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Any:
       return AutoTokenizer.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModel.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Tuple:
       return AutoModel.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForCausalLM.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Tuple:
       return AutoModelForCausalLM.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForMaskedLM.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Optional[Any]:
       return AutoModelForMaskedLM.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForSequenceClassification.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						List[str]:
       return AutoModelForSequenceClassification.from_pretrained(*__snake_case   ,      **__snake_case )





@add_start_docstrings(AutoModelForQuestionAnswering.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						List[Any]:
       return AutoModelForQuestionAnswering.from_pretrained(*__snake_case   ,      **__snake_case )







import os
import sys
import unittest


__a:     Optional[int]   					=					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,
)


__a:     Dict   					=					os.path.join('''tests''', '''models''', '''bert''', '''test_modeling_bert.py''')
__a:     Union[str, Any]   					=					os.path.join('''tests''', '''models''', '''blip''', '''test_modeling_blip.py''')
class 		SCREAMING_SNAKE_CASE__	(  unittest.TestCase     ):

  '''simple docstring'''







  def  lowerCamelCase       (      self		:			str							)						->	Dict:


         """simple docstring"""
         _UpperCAmelCase							=    get_test_to_tester_mapping(lowerCamelCase							)
         _UpperCAmelCase							=    get_test_to_tester_mapping(lowerCamelCase							)

         _UpperCAmelCase							=    {"""BertModelTest""": """BertModelTester"""}

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

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


  def  lowerCamelCase       (      self		:			Optional[int]							)						->	str:


         """simple docstring"""
         _UpperCAmelCase							=    get_model_to_test_mapping(lowerCamelCase							)
         _UpperCAmelCase							=    get_model_to_test_mapping(lowerCamelCase							)

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

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

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





  def  lowerCamelCase       (      self		:			int							)						->	Any:


         """simple docstring"""
         _UpperCAmelCase							=    get_model_to_tester_mapping(lowerCamelCase							)
         _UpperCAmelCase							=    get_model_to_tester_mapping(lowerCamelCase							)

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

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

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