




import os
import sys
import unittest


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







class     __lowerCAmelCase (       unittest.TestCase ):

			"""simple docstring"""







			def       lowercase_    (      self							)    ->      str:



							'''simple docstring'''
							__lowerCamelCase		       =    get_test_to_tester_mapping(lowerCamelCase__							)
							__lowerCamelCase		       =    get_test_to_tester_mapping(lowerCamelCase__							)

							__lowerCamelCase		       =    {'BertModelTest': 'BertModelTester'}

							__lowerCamelCase		       =    {
							    '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       lowercase_    (      self							)    ->      Optional[int]:



							'''simple docstring'''
							__lowerCamelCase		       =    get_model_to_test_mapping(lowerCamelCase__							)
							__lowerCamelCase		       =    get_model_to_test_mapping(lowerCamelCase__							)

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

							__lowerCamelCase		       =    {
							    '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       lowercase_    (      self							)    ->      Union[str, Any]:



							'''simple docstring'''
							__lowerCamelCase		       =    get_model_to_tester_mapping(lowerCamelCase__							)
							__lowerCamelCase		       =    get_model_to_tester_mapping(lowerCamelCase__							)

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

							__lowerCamelCase		       =    {
							    '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__							)





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_									=   {'configuration_xlnet': ['XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XLNetConfig']}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   ['XLNetTokenizer']

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   ['XLNetTokenizerFast']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   [
      'XLNET_PRETRAINED_MODEL_ARCHIVE_LIST',
      'XLNetForMultipleChoice',
      'XLNetForQuestionAnswering',
      'XLNetForQuestionAnsweringSimple',
      'XLNetForSequenceClassification',
      'XLNetForTokenClassification',
      'XLNetLMHeadModel',
      'XLNetModel',
      'XLNetPreTrainedModel',
      'load_tf_weights_in_xlnet',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   [
      'TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST',
      'TFXLNetForMultipleChoice',
      'TFXLNetForQuestionAnsweringSimple',
      'TFXLNetForSequenceClassification',
      'TFXLNetForTokenClassification',
      'TFXLNetLMHeadModel',
      'TFXLNetMainLayer',
      'TFXLNetModel',
      'TFXLNetPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_xlnet import XLNetTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_xlnet_fast import XLNetTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_xlnet import (
        XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        XLNetForMultipleChoice,
        XLNetForQuestionAnswering,
        XLNetForQuestionAnsweringSimple,
        XLNetForSequenceClassification,
        XLNetForTokenClassification,
        XLNetLMHeadModel,
        XLNetModel,
        XLNetPreTrainedModel,
        load_tf_weights_in_xlnet,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_xlnet import (
        TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFXLNetForMultipleChoice,
        TFXLNetForQuestionAnsweringSimple,
        TFXLNetForSequenceClassification,
        TFXLNetForTokenClassification,
        TFXLNetLMHeadModel,
        TFXLNetMainLayer,
        TFXLNetModel,
        TFXLNetPreTrainedModel,
    )

else:
  import sys

  lowercase_									=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


