






import inspect
import unittest
import warnings
from typing import List

from transformers import EfficientFormerConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch

			from transformers import (
			    MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
			    MODEL_MAPPING,
			    EfficientFormerForImageClassification,
			    EfficientFormerForImageClassificationWithTeacher,
			    EfficientFormerModel,
			)
			from transformers.models.efficientformer.modeling_efficientformer import (
			    EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
			)


if is_vision_available():
			from PIL import Image

			from transformers import EfficientFormerImageProcessor




class        _lowerCAmelCase:





							"""simple docstring"""







							def __init__(      self						,    _lowerCamelCase						,    _lowerCamelCase = 1_3						,    _lowerCamelCase = 6_4						,    _lowerCamelCase = 2						,    _lowerCamelCase = 3						,    _lowerCamelCase = 3						,    _lowerCamelCase = True						,    _lowerCamelCase = True						,    _lowerCamelCase = 1_2_8						,    _lowerCamelCase=[1_6, 3_2, 6_4, 1_2_8]						,    _lowerCamelCase = 7						,    _lowerCamelCase = 4						,    _lowerCamelCase = 3_7						,    _lowerCamelCase = "gelu"						,    _lowerCamelCase = 0.1						,    _lowerCamelCase = 0.1						,    _lowerCamelCase = 1_0						,    _lowerCamelCase = 0.0_2						,    _lowerCamelCase = 2						,    _lowerCamelCase = 1						,    _lowerCamelCase = 1_2_8						,    _lowerCamelCase = [2, 2, 2, 2]						,    _lowerCamelCase = 2						,    _lowerCamelCase = 2						,    ):
									UpperCamelCase_:      Union[str, Any]					   =       parent
									UpperCamelCase_:      Any					   =       batch_size
									UpperCamelCase_:      Optional[Any]					   =       image_size
									UpperCamelCase_:      str					   =       patch_size
									UpperCamelCase_:      Dict					   =       num_channels
									UpperCamelCase_:      List[Any]					   =       is_training
									UpperCamelCase_:      int					   =       use_labels
									UpperCamelCase_:      str					   =       hidden_size
									UpperCamelCase_:      int					   =       num_hidden_layers
									UpperCamelCase_:      List[str]					   =       num_attention_heads
									UpperCamelCase_:      str					   =       intermediate_size
									UpperCamelCase_:      List[Any]					   =       hidden_act
									UpperCamelCase_:      Union[str, Any]					   =       hidden_dropout_prob
									UpperCamelCase_:      Any					   =       attention_probs_dropout_prob
									UpperCamelCase_:      Any					   =       type_sequence_label_size
									UpperCamelCase_:      List[str]					   =       initializer_range
									UpperCamelCase_:      Union[str, Any]					   =       encoder_stride
									UpperCamelCase_:      Optional[Any]					   =       num_attention_outputs
									UpperCamelCase_:      int					   =       embed_dim
									UpperCamelCase_:      int					   =       embed_dim + 1
									UpperCamelCase_:      str					   =       resolution
									UpperCamelCase_:      Dict					   =       depths
									UpperCamelCase_:      Tuple					   =       hidden_sizes
									UpperCamelCase_:      Optional[Any]					   =       dim
									UpperCamelCase_:      int					   =       mlp_expansion_ratio





							def     _a					(      self							):
									UpperCamelCase_:      Union[str, Any]					   =       floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)

									UpperCamelCase_:      Union[str, Any]					   =       None
									if self.use_labels:
											UpperCamelCase_:      Optional[int]					   =       ids_tensor([self.batch_size]						,    self.type_sequence_label_size							)

									UpperCamelCase_:      int					   =       self.get_config()
									return config, pixel_values, labels





							def     _a					(      self							):
									return EfficientFormerConfig(
									    image_size=self.image_size						,    patch_size=self.patch_size						,    num_channels=self.num_channels						,    hidden_size=self.hidden_size						,    num_hidden_layers=self.num_hidden_layers						,    num_attention_heads=self.num_attention_heads						,    intermediate_size=self.intermediate_size						,    hidden_act=self.hidden_act						,    hidden_dropout_prob=self.hidden_dropout_prob						,    attention_probs_dropout_prob=self.attention_probs_dropout_prob						,    is_decoder=_lowerCamelCase						,    initializer_range=self.initializer_range						,    encoder_stride=self.encoder_stride						,    resolution=self.resolution						,    depths=self.depths						,    hidden_sizes=self.hidden_sizes						,    dim=self.dim						,    mlp_expansion_ratio=self.mlp_expansion_ratio						,    )





							def     _a					(      self						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase							):
									UpperCamelCase_:      List[Any]					   =       EfficientFormerModel(config=_lowerCamelCase							)
									model.to(_lowerCamelCase							)
									model.eval()
									UpperCamelCase_:      Optional[Any]					   =       model(_lowerCamelCase							)
									self.parent.assertEqual(result.last_hidden_state.shape						,    (self.batch_size, self.seq_length, self.hidden_size)							)





							def     _a					(      self						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase							):
									UpperCamelCase_:      List[str]					   =       self.type_sequence_label_size
									UpperCamelCase_:      Optional[Any]					   =       EfficientFormerForImageClassification(_lowerCamelCase							)
									model.to(_lowerCamelCase							)
									model.eval()
									UpperCamelCase_:      Optional[int]					   =       model(_lowerCamelCase						,    labels=_lowerCamelCase							)
									self.parent.assertEqual(result.logits.shape						,    (self.batch_size, self.type_sequence_label_size)							)

									# test greyscale images
									UpperCamelCase_:      Tuple					   =       1
									UpperCamelCase_:      Any					   =       EfficientFormerForImageClassification(_lowerCamelCase							)
									model.to(_lowerCamelCase							)
									model.eval()

									UpperCamelCase_:      List[Any]					   =       floats_tensor([self.batch_size, 1, self.image_size, self.image_size]							)
									UpperCamelCase_:      List[str]					   =       model(_lowerCamelCase							)
									self.parent.assertEqual(result.logits.shape						,    (self.batch_size, self.type_sequence_label_size)							)





							def     _a					(      self							):
									UpperCamelCase_:      Dict					   =       self.prepare_config_and_inputs()
									(
									    UpperCamelCase_
									):      Tuple					   =       config_and_inputs
									UpperCamelCase_:      Any					   =       {'pixel_values': pixel_values}
									return config, inputs_dict







@require_torch
class        _lowerCAmelCase( UpperCAmelCase_							,			UpperCAmelCase_							,			unittest.TestCase      ):





							"""simple docstring"""







							a       :	List[Any]								=(
							    (
							        EfficientFormerModel,
							        EfficientFormerForImageClassificationWithTeacher,
							        EfficientFormerForImageClassification,
							    )
							    if is_torch_available()
							    else ()
							)
							a       :	Any								=(
							    {
							        '''feature-extraction''': EfficientFormerModel,
							        '''image-classification''': (
							            EfficientFormerForImageClassification,
							            EfficientFormerForImageClassificationWithTeacher,
							        ),
							    }
							    if is_torch_available()
							    else {}
							)
							a       :	Tuple								=False

							a       :	Any								=False
							a       :	Dict								=False
							a       :	str								=False





							def     _a					(      self							):
									UpperCamelCase_:      int					   =       EfficientFormerModelTester(self							)
									UpperCamelCase_:      Optional[Any]					   =       ConfigTester(
									    self						,    config_class=_lowerCamelCase						,    has_text_modality=_lowerCamelCase						,    hidden_size=3_7							)





							def     _a					(      self							):
									self.config_tester.run_common_tests()





							@unittest.skip(reason='EfficientFormer does not use inputs_embeds'							)
							def     _a					(      self							):
									pass





							@unittest.skip(reason='EfficientFormer does not support input and output embeddings'							)
							def     _a					(      self							):
									pass





							def     _a					(      self							):
									UpperCamelCase_:      List[Any]					   =       self.model_tester.prepare_config_and_inputs_for_common()

									for model_class in self.all_model_classes:
											UpperCamelCase_:      Dict					   =       model_class(_lowerCamelCase							)
											UpperCamelCase_:      Optional[Any]					   =       inspect.signature(model.forward							)
											# signature.parameters is an OrderedDict => so arg_names order is deterministic
											UpperCamelCase_:      Dict					   =       [*signature.parameters.keys()]

											UpperCamelCase_:      str					   =       ['pixel_values']
											self.assertListEqual(arg_names[:1]						,    _lowerCamelCase							)





							def     _a					(      self							):
									def check_hidden_states_output(_lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase							):
											UpperCamelCase_:      Tuple					   =       model_class(_lowerCamelCase							)
											model.to(_lowerCamelCase							)
											model.eval()

											with torch.no_grad():
													UpperCamelCase_:      Any					   =       model(**self._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase							)							)

											UpperCamelCase_:      Dict					   =       outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

											UpperCamelCase_:      Dict					   =       getattr(
											    self.model_tester						,    'expected_num_hidden_layers'						,    self.model_tester.num_hidden_layers + 1							)
											self.assertEqual(len(_lowerCamelCase							)						,    _lowerCamelCase							)

											if hasattr(self.model_tester						,    'encoder_seq_length'							):
													UpperCamelCase_:      Optional[Any]					   =       self.model_tester.encoder_seq_length
													if hasattr(self.model_tester						,    'chunk_length'							) and self.model_tester.chunk_length > 1:
															UpperCamelCase_:      Tuple					   =       seq_length * self.model_tester.chunk_length
											else:
													UpperCamelCase_:      Optional[int]					   =       self.model_tester.seq_length

											self.assertListEqual(
											    list(hidden_states[-1].shape[-2:]							)						,    [seq_length, self.model_tester.hidden_size]						,    )

											if config.is_encoder_decoder:
													UpperCamelCase_:      Optional[Any]					   =       outputs.decoder_hidden_states

													self.assertIsInstance(_lowerCamelCase						,    (list, tuple)							)
													self.assertEqual(len(_lowerCamelCase							)						,    _lowerCamelCase							)
													UpperCamelCase_:      List[Any]					   =       getattr(self.model_tester						,    'seq_length'						,    _lowerCamelCase							)
													UpperCamelCase_:      Union[str, Any]					   =       getattr(self.model_tester						,    'decoder_seq_length'						,    _lowerCamelCase							)

													self.assertListEqual(
													    list(hidden_states[-1].shape[-2:]							)						,    [decoder_seq_length, self.model_tester.hidden_size]						,    )

									UpperCamelCase_:      int					   =       self.model_tester.prepare_config_and_inputs_for_common()

									for model_class in self.all_model_classes:
											UpperCamelCase_:      Any					   =       True
											check_hidden_states_output(_lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase							)

											# check that output_hidden_states also work using config
											del inputs_dict["output_hidden_states"]
											UpperCamelCase_:      Tuple					   =       True

											check_hidden_states_output(_lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase							)





							def     _a					(      self						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase=False							):
									UpperCamelCase_:      Any					   =       super()._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase						,    return_labels=_lowerCamelCase							)

									if return_labels:
											if model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher":
													del inputs_dict["labels"]

									return inputs_dict





							def     _a					(      self							):
									UpperCamelCase_:      List[Any]					   =       self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*_lowerCamelCase							)





							@unittest.skip(reason='EfficientFormer does not implement masked image modeling yet'							)
							def     _a					(      self							):
									UpperCamelCase_:      Any					   =       self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_masked_image_modeling(*_lowerCamelCase							)





							def     _a					(      self							):
									UpperCamelCase_:      str					   =       self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_image_classification(*_lowerCamelCase							)





							def     _a					(      self							):
									if not self.model_tester.is_training:
											return

									UpperCamelCase_:      int					   =       self.model_tester.prepare_config_and_inputs_for_common()
									UpperCamelCase_:      Dict					   =       True

									for model_class in self.all_model_classes:
											# EfficientFormerForImageClassificationWithTeacher supports inference-only
											if (
											    model_class in get_values(_lowerCamelCase							)
											    or model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher"
											):
													continue
											UpperCamelCase_:      List[str]					   =       model_class(_lowerCamelCase							)
											model.to(_lowerCamelCase							)
											model.train()
											UpperCamelCase_:      str					   =       self._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase						,    return_labels=_lowerCamelCase							)
											UpperCamelCase_:      List[str]					   =       model(**_lowerCamelCase							).loss
											loss.backward()





							def     _a					(      self							):
									UpperCamelCase_:      Any					   =       self.model_tester.prepare_config_and_inputs_for_common()

									UpperCamelCase_:      Optional[int]					   =       [
									    {'title': 'multi_label_classification', 'num_labels': 2, 'dtype': torch.float},
									    {'title': 'single_label_classification', 'num_labels': 1, 'dtype': torch.long},
									    {'title': 'regression', 'num_labels': 1, 'dtype': torch.float},
									]

									for model_class in self.all_model_classes:
											if (
											    model_class
											    not in [
											        *get_values(_lowerCamelCase							),
											    ]
											    or model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher"
											):
													continue

											for problem_type in problem_types:
													with self.subTest(msg=f'''Testing {model_class} with {problem_type['title']}'''							):
															UpperCamelCase_:      Any					   =       problem_type['title']
															UpperCamelCase_:      List[Any]					   =       problem_type['num_labels']

															UpperCamelCase_:      Tuple					   =       model_class(_lowerCamelCase							)
															model.to(_lowerCamelCase							)
															model.train()

															UpperCamelCase_:      List[str]					   =       self._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase						,    return_labels=_lowerCamelCase							)

															if problem_type["num_labels"] > 1:
																	UpperCamelCase_:      str					   =       inputs['labels'].unsqueeze(1							).repeat(1						,    problem_type['num_labels']							)

															UpperCamelCase_:      Dict					   =       inputs['labels'].to(problem_type['dtype']							)

															# This tests that we do not trigger the warning form PyTorch "Using a target size that is different
															# to the input size. This will likely lead to incorrect results due to broadcasting. Please ensure
															# they have the same size." which is a symptom something in wrong for the regression problem.
															# See https://github.com/huggingface/transformers/issues/11780
															with warnings.catch_warnings(record=_lowerCamelCase							) as warning_list:
																	UpperCamelCase_:      Optional[Any]					   =       model(**_lowerCamelCase							).loss
															for w in warning_list:
																	if "Using a target size that is different to the input size" in str(w.message							):
																			raise ValueError(
																			    f'''Something is going wrong in the regression problem: intercepted {w.message}'''							)

															loss.backward()





							@slow
							def     _a					(      self							):
									for model_name in EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											UpperCamelCase_:      Union[str, Any]					   =       EfficientFormerModel.from_pretrained(_lowerCamelCase							)
											self.assertIsNotNone(_lowerCamelCase							)





							def     _a					(      self							):
									UpperCamelCase_:      int					   =       self.model_tester.prepare_config_and_inputs_for_common()
									UpperCamelCase_:      str					   =       True

									UpperCamelCase_:      int					   =       getattr(self.model_tester						,    'seq_length'						,    _lowerCamelCase							)
									UpperCamelCase_:      Optional[int]					   =       getattr(self.model_tester						,    'encoder_seq_length'						,    _lowerCamelCase							)
									UpperCamelCase_:      Optional[int]					   =       getattr(self.model_tester						,    'key_length'						,    _lowerCamelCase							)
									UpperCamelCase_:      int					   =       getattr(self.model_tester						,    'chunk_length'						,    _lowerCamelCase							)

									if chunk_length is not None and hasattr(self.model_tester						,    'num_hashes'							):
											UpperCamelCase_:      Union[str, Any]					   =       encoder_seq_length * self.model_tester.num_hashes

									for model_class in self.all_model_classes:
											UpperCamelCase_:      Optional[Any]					   =       True
											UpperCamelCase_:      Union[str, Any]					   =       False
											UpperCamelCase_:      List[str]					   =       True
											UpperCamelCase_:      Dict					   =       model_class(_lowerCamelCase							)
											model.to(_lowerCamelCase							)
											model.eval()
											with torch.no_grad():
													UpperCamelCase_:      Optional[int]					   =       model(**self._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase							)							)
											UpperCamelCase_:      int					   =       outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
											self.assertEqual(len(_lowerCamelCase							)						,    self.model_tester.num_attention_outputs							)

											# check that output_attentions also work using config
											del inputs_dict["output_attentions"]
											UpperCamelCase_:      Optional[int]					   =       True
											UpperCamelCase_:      Any					   =       model_class(_lowerCamelCase							)
											model.to(_lowerCamelCase							)
											model.eval()
											with torch.no_grad():
													UpperCamelCase_:      int					   =       model(**self._prepare_for_class(_lowerCamelCase						,    _lowerCamelCase							)							)
											UpperCamelCase_:      Dict					   =       outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
											self.assertEqual(len(_lowerCamelCase							)						,    self.model_tester.num_attention_outputs							)

											if chunk_length is not None:
													self.assertListEqual(
													    list(attentions[0].shape[-4:]							)						,    [self.model_tester.num_attention_heads, encoder_seq_length, chunk_length, encoder_key_length]						,    )
											else:
													self.assertListEqual(
													    list(attentions[0].shape[-3:]							)						,    [self.model_tester.num_attention_heads, encoder_seq_length, encoder_key_length]						,    )







def 						snake_case      () ->       str:
		UpperCamelCase_:      Any					   =       Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'						)
		return image




@require_torch
@require_vision
class        _lowerCAmelCase( unittest.TestCase      ):





							"""simple docstring"""







							@cached_property
							def     _a					(      self							):
									return (
									    EfficientFormerImageProcessor.from_pretrained('snap-research/efficientformer-l1-300'							)
									    if is_vision_available()
									    else None
									)





							@slow
							def     _a					(      self							):
									UpperCamelCase_:      List[Any]					   =       EfficientFormerForImageClassification.from_pretrained('snap-research/efficientformer-l1-300'							).to(
									    _lowerCamelCase							)

									UpperCamelCase_:      Optional[int]					   =       self.default_image_processor
									UpperCamelCase_:      Optional[int]					   =       prepare_img()
									UpperCamelCase_:      List[str]					   =       image_processor(images=_lowerCamelCase						,    return_tensors='pt'							).to(_lowerCamelCase							)

									# forward pass
									with torch.no_grad():
											UpperCamelCase_:      Dict					   =       model(**_lowerCamelCase							)

									# verify the logits
									UpperCamelCase_:      str					   =       (1, 1_0_0_0)
									self.assertEqual(outputs.logits.shape						,    _lowerCamelCase							)

									UpperCamelCase_:      List[str]					   =       torch.tensor([-0.0_5_5_5, 0.4_8_2_5, -0.0_8_5_2]							).to(_lowerCamelCase							)
									self.assertTrue(torch.allclose(outputs.logits[0][:3]						,    _lowerCamelCase						,    atol=1e-4							)							)





							@slow
							def     _a					(      self							):
									UpperCamelCase_:      str					   =       EfficientFormerForImageClassificationWithTeacher.from_pretrained(
									    'snap-research/efficientformer-l1-300'							).to(_lowerCamelCase							)

									UpperCamelCase_:      List[str]					   =       self.default_image_processor
									UpperCamelCase_:      str					   =       prepare_img()
									UpperCamelCase_:      Tuple					   =       image_processor(images=_lowerCamelCase						,    return_tensors='pt'							).to(_lowerCamelCase							)

									# forward pass
									with torch.no_grad():
											UpperCamelCase_:      Optional[int]					   =       model(**_lowerCamelCase							)

									# verify the logits
									UpperCamelCase_:      List[Any]					   =       (1, 1_0_0_0)
									self.assertEqual(outputs.logits.shape						,    _lowerCamelCase							)

									UpperCamelCase_:      str					   =       torch.tensor([-0.1_3_1_2, 0.4_3_5_3, -1.0_4_9_9]							).to(_lowerCamelCase							)
									self.assertTrue(torch.allclose(outputs.logits[0][:3]						,    _lowerCamelCase						,    atol=1e-4							)							)







from typing import TYPE_CHECKING

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


A_	:	List[Any]				=				{
    'configuration_openai': ['OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'OpenAIGPTConfig'],
    'tokenization_openai': ['OpenAIGPTTokenizer'],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	List[str]				=				['OpenAIGPTTokenizerFast']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	Any				=				[
       'OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'OpenAIGPTDoubleHeadsModel',
       'OpenAIGPTForSequenceClassification',
       'OpenAIGPTLMHeadModel',
       'OpenAIGPTModel',
       'OpenAIGPTPreTrainedModel',
       'load_tf_weights_in_openai_gpt',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_	:	str				=				[
       'TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFOpenAIGPTDoubleHeadsModel',
       'TFOpenAIGPTForSequenceClassification',
       'TFOpenAIGPTLMHeadModel',
       'TFOpenAIGPTMainLayer',
       'TFOpenAIGPTModel',
       'TFOpenAIGPTPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig
   from .tokenization_openai import OpenAIGPTTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_openai_fast import OpenAIGPTTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_openai import (
          OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
          OpenAIGPTDoubleHeadsModel,
          OpenAIGPTForSequenceClassification,
          OpenAIGPTLMHeadModel,
          OpenAIGPTModel,
          OpenAIGPTPreTrainedModel,
          load_tf_weights_in_openai_gpt,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_openai import (
          TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFOpenAIGPTDoubleHeadsModel,
          TFOpenAIGPTForSequenceClassification,
          TFOpenAIGPTLMHeadModel,
          TFOpenAIGPTMainLayer,
          TFOpenAIGPTModel,
          TFOpenAIGPTPreTrainedModel,
      )

else:
   import sys

   A_	:	str				=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)