import os
import sys
import unittest


_UpperCAmelCase            =		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,
)


_UpperCAmelCase            =		os.path.join("""tests""", """models""", """bert""", """test_modeling_bert.py""")
_UpperCAmelCase            =		os.path.join("""tests""", """models""", """blip""", """test_modeling_blip.py""")





class UpperCAmelCase						( unittest.TestCase  ):


				'''simple docstring'''






				def   lowerCAmelCase_       (						self ):



						"""simple docstring"""





						A_		:    Union[str, Any]         =				get_test_to_tester_mapping(lowercase )
						A_		:    Dict         =				get_test_to_tester_mapping(lowercase )

						A_		:    Optional[int]         =				{'BertModelTest': 'BertModelTester'}

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

						self.assertEqual(get_test_info.to_json(lowercase )		,     lowercase )
						self.assertEqual(get_test_info.to_json(lowercase )		,     lowercase )
				def   lowerCAmelCase_       (						self ):



						"""simple docstring"""





						A_		:    Any         =				get_model_to_test_mapping(lowercase )
						A_		:    int         =				get_model_to_test_mapping(lowercase )

						A_		:    Union[str, Any]         =				{
						    'BertForMaskedLM': ['BertModelTest'],
						    'BertForMultipleChoice': ['BertModelTest'],
						    'BertForNextSentencePrediction': ['BertModelTest'],
						    'BertForPreTraining': ['BertModelTest'],
						    'BertForQuestionAnswering': ['BertModelTest'],
						    'BertForSequenceClassification': ['BertModelTest'],
						    'BertForTokenClassification': ['BertModelTest'],
						    'BertLMHeadModel': ['BertModelTest'],
						    'BertModel': ['BertModelTest'],
						}

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

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







				def   lowerCAmelCase_       (						self ):



						"""simple docstring"""





						A_		:    Optional[int]         =				get_model_to_tester_mapping(lowercase )
						A_		:    Dict         =				get_model_to_tester_mapping(lowercase )

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

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

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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_UpperCAmelCase            =		{
    """configuration_bridgetower""": [
        """BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BridgeTowerConfig""",
        """BridgeTowerTextConfig""",
        """BridgeTowerVisionConfig""",
    ],
    """processing_bridgetower""": ["""BridgeTowerProcessor"""],
}

try:
	if not is_vision_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCAmelCase            =		["""BridgeTowerImageProcessor"""]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCAmelCase            =		[
	    """BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """BridgeTowerForContrastiveLearning""",
	    """BridgeTowerForImageAndTextRetrieval""",
	    """BridgeTowerForMaskedLM""",
	    """BridgeTowerModel""",
	    """BridgeTowerPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_bridgetower import (
	    BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    BridgeTowerConfig,
	    BridgeTowerTextConfig,
	    BridgeTowerVisionConfig,
	)
	from .processing_bridgetower import BridgeTowerProcessor

	try:
		if not is_vision_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .image_processing_bridgetower import BridgeTowerImageProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_bridgetower import (
		    BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    BridgeTowerForContrastiveLearning,
		    BridgeTowerForImageAndTextRetrieval,
		    BridgeTowerForMaskedLM,
		    BridgeTowerModel,
		    BridgeTowerPreTrainedModel,
		)


else:
	import sys

	_UpperCAmelCase            =		_LazyModule(__name__, globals()["""__file__"""], _import_structure)






