
"""simple docstring"""






import inspect
import unittest
from typing import List

import numpy as np

from transformers import EfficientFormerConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
					import tensorflow as tf

					from transformers import (
					    TFEfficientFormerForImageClassification,
					    TFEfficientFormerForImageClassificationWithTeacher,
					    TFEfficientFormerModel,
					)
					from transformers.models.efficientformer.modeling_tf_efficientformer import (
					    TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
					)


if is_vision_available():
					from PIL import Image

					from transformers import EfficientFormerImageProcessor




class 				lowercase__:
	'''simple docstring'''

	def __init__(						self    :Tuple		, lowerCamelCase_    :Any		, lowerCamelCase_    :str = 13		, lowerCamelCase_    :Union[str, Any] = 64		, lowerCamelCase_    :Optional[Any] = 2		, lowerCamelCase_    :Dict = 3		, lowerCamelCase_    :List[Any] = 3		, lowerCamelCase_    :Tuple = True		, lowerCamelCase_    :Union[str, Any] = True		, lowerCamelCase_    :List[str] = 1_28		, lowerCamelCase_    :str=[16, 32, 64, 1_28]		, lowerCamelCase_    :Union[str, Any] = 7		, lowerCamelCase_    :Any = 4		, lowerCamelCase_    :Any = 37		, lowerCamelCase_    :int = "gelu"		, lowerCamelCase_    :List[Any] = 0.1		, lowerCamelCase_    :Any = 0.1		, lowerCamelCase_    :List[str] = 10		, lowerCamelCase_    :str = 0.0_2		, lowerCamelCase_    :Any = 2		, lowerCamelCase_    :str = 1		, lowerCamelCase_    :Optional[Any] = 1_28		, lowerCamelCase_    :Dict = [2, 2, 2, 2]		, lowerCamelCase_    :Union[str, Any] = 2		, lowerCamelCase_    :Any = 2		, )							->			Optional[int]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     List[str]				= parent
			SCREAMING_SNAKE_CASE       :     Dict				= batch_size
			SCREAMING_SNAKE_CASE       :     Optional[int]				= image_size
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= patch_size
			SCREAMING_SNAKE_CASE       :     List[str]				= num_channels
			SCREAMING_SNAKE_CASE       :     Tuple				= is_training
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= use_labels
			SCREAMING_SNAKE_CASE       :     Optional[int]				= hidden_size
			SCREAMING_SNAKE_CASE       :     List[Any]				= num_hidden_layers
			SCREAMING_SNAKE_CASE       :     Tuple				= num_attention_heads
			SCREAMING_SNAKE_CASE       :     List[Any]				= intermediate_size
			SCREAMING_SNAKE_CASE       :     Any				= hidden_act
			SCREAMING_SNAKE_CASE       :     Dict				= hidden_dropout_prob
			SCREAMING_SNAKE_CASE       :     Optional[int]				= attention_probs_dropout_prob
			SCREAMING_SNAKE_CASE       :     List[Any]				= type_sequence_label_size
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= initializer_range
			SCREAMING_SNAKE_CASE       :     Any				= encoder_stride
			SCREAMING_SNAKE_CASE       :     str				= num_attention_outputs
			SCREAMING_SNAKE_CASE       :     str				= embed_dim
			SCREAMING_SNAKE_CASE       :     Dict				= embed_dim + 1
			SCREAMING_SNAKE_CASE       :     str				= resolution
			SCREAMING_SNAKE_CASE       :     int				= depths
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= hidden_sizes
			SCREAMING_SNAKE_CASE       :     str				= dim
			SCREAMING_SNAKE_CASE       :     Any				= mlp_expansion_ratio





	def   __lowerCAmelCase (						self    :Union[str, Any]					)							->			Any:







			'''simple docstring'''




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

			SCREAMING_SNAKE_CASE       :     Optional[int]				= None
			if self.use_labels:
					SCREAMING_SNAKE_CASE       :     Tuple				= ids_tensor([self.batch_size]		, self.type_sequence_label_size					)

			SCREAMING_SNAKE_CASE       :     Tuple				= self.get_config()

			return config, pixel_values, labels





	def   __lowerCAmelCase (						self    :List[Any]					)							->			Optional[Any]:







			'''simple docstring'''




			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=a_		, 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   __lowerCAmelCase (						self    :Any		, lowerCamelCase_    :Dict		, lowerCamelCase_    :Union[str, Any]		, lowerCamelCase_    :Optional[int]					)							->			Union[str, Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= TFEfficientFormerModel(config=a_					)
			SCREAMING_SNAKE_CASE       :     Optional[int]				= model(a_		, training=a_					)
			self.parent.assertEqual(result.last_hidden_state.shape		, (self.batch_size, self.seq_length, self.hidden_size)					)





	def   __lowerCAmelCase (						self    :List[Any]		, lowerCamelCase_    :Optional[Any]		, lowerCamelCase_    :Any		, lowerCamelCase_    :Optional[int]					)							->			Optional[Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Optional[Any]				= self.type_sequence_label_size
			SCREAMING_SNAKE_CASE       :     List[str]				= TFEfficientFormerForImageClassification(a_					)
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= model(a_		, labels=a_		, training=a_					)
			self.parent.assertEqual(result.logits.shape		, (self.batch_size, self.type_sequence_label_size)					)

			# test greyscale images
			SCREAMING_SNAKE_CASE       :     int				= 1
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= TFEfficientFormerForImageClassification(a_					)

			SCREAMING_SNAKE_CASE       :     Optional[Any]				= floats_tensor([self.batch_size, 1, self.image_size, self.image_size]					)
			SCREAMING_SNAKE_CASE       :     List[Any]				= model(a_		, labels=a_					)
			self.parent.assertEqual(result.logits.shape		, (self.batch_size, self.type_sequence_label_size)					)







	def   __lowerCAmelCase (						self    :Union[str, Any]					)							->			Optional[Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Any				= self.prepare_config_and_inputs()
			SCREAMING_SNAKE_CASE       :     List[Any]				= config_and_inputs
			SCREAMING_SNAKE_CASE       :     Optional[int]				= {"pixel_values": pixel_values}
			return config, inputs_dict





@require_tf
class 				lowercase__(				__lowerCamelCase		,						__lowerCamelCase		,						unittest.TestCase   ):
	'''simple docstring'''

	UpperCamelCase				=  (
	    (
	        TFEfficientFormerModel,
	        TFEfficientFormerForImageClassificationWithTeacher,
	        TFEfficientFormerForImageClassification,
	    )
	    if is_tf_available()
	    else ()
	)
	UpperCamelCase				=  (
	    {
	        '''feature-extraction''': TFEfficientFormerModel,
	        '''image-classification''': (
	            TFEfficientFormerForImageClassification,
	            TFEfficientFormerForImageClassificationWithTeacher,
	        ),
	    }
	    if is_tf_available()
	    else {}
	)

	UpperCamelCase				=  False

	UpperCamelCase				=  False
	UpperCamelCase				=  False
	UpperCamelCase				=  False
	UpperCamelCase				=  False





	def   __lowerCAmelCase (						self    :Dict					)							->			Dict:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     int				= TFEfficientFormerModelTester(self					)
			SCREAMING_SNAKE_CASE       :     str				= ConfigTester(
			    self		, config_class=a_		, has_text_modality=a_		, hidden_size=37					)





	def   __lowerCAmelCase (						self    :Optional[int]					)							->			Dict:







			'''simple docstring'''




			self.config_tester.run_common_tests()





	@unittest.skip(reason='''EfficientFormer does not use inputs_embeds'''					)
	def   __lowerCAmelCase (						self    :Union[str, Any]					)							->			Optional[Any]:







			'''simple docstring'''




			pass





	@unittest.skip(reason='''EfficientFormer does not support input and output embeddings'''					)
	def   __lowerCAmelCase (						self    :Optional[Any]					)							->			Union[str, Any]:







			'''simple docstring'''




			pass





	def   __lowerCAmelCase (						self    :Dict					)							->			Tuple:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Tuple				= self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
					SCREAMING_SNAKE_CASE       :     str				= model_class(a_					)
					SCREAMING_SNAKE_CASE       :     str				= inspect.signature(model.call					)
					# signature.parameters is an OrderedDict => so arg_names order is deterministic
					SCREAMING_SNAKE_CASE       :     Optional[int]				= [*signature.parameters.keys()]

					SCREAMING_SNAKE_CASE       :     Optional[Any]				= ["pixel_values"]
					self.assertListEqual(arg_names[:1]		, a_					)





	def   __lowerCAmelCase (						self    :Optional[int]					)							->			Union[str, Any]:







			'''simple docstring'''




			def check_hidden_states_output(lowerCamelCase_    :Optional[Any]		, lowerCamelCase_    :Optional[int]		, lowerCamelCase_    :Any					):
					SCREAMING_SNAKE_CASE       :     int				= model_class(a_					)

					SCREAMING_SNAKE_CASE       :     int				= model(**self._prepare_for_class(a_		, a_					)		, training=a_					)
					SCREAMING_SNAKE_CASE       :     Any				= outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

					SCREAMING_SNAKE_CASE       :     List[Any]				= getattr(
					    self.model_tester		, '''expected_num_hidden_layers'''		, self.model_tester.num_hidden_layers + 1					)
					self.assertEqual(len(a_					)		, a_					)

					if hasattr(self.model_tester		, '''encoder_seq_length'''					):
							SCREAMING_SNAKE_CASE       :     List[Any]				= self.model_tester.encoder_seq_length
							if hasattr(self.model_tester		, '''chunk_length'''					) and self.model_tester.chunk_length > 1:
									SCREAMING_SNAKE_CASE       :     int				= seq_length * self.model_tester.chunk_length
					else:
							SCREAMING_SNAKE_CASE       :     Union[str, Any]				= 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:
							SCREAMING_SNAKE_CASE       :     str				= outputs.decoder_hidden_states

							self.asseretIsInstance(a_		, (list, tuple)					)
							self.assertEqual(len(a_					)		, a_					)
							SCREAMING_SNAKE_CASE       :     Any				= getattr(self.model_tester		, '''seq_length'''		, a_					)
							SCREAMING_SNAKE_CASE       :     Union[str, Any]				= getattr(self.model_tester		, '''decoder_seq_length'''		, a_					)

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

			SCREAMING_SNAKE_CASE       :     Any				= self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
					SCREAMING_SNAKE_CASE       :     Optional[int]				= True
					check_hidden_states_output(a_		, a_		, a_					)

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

					check_hidden_states_output(a_		, a_		, a_					)





	def   __lowerCAmelCase (						self    :Optional[int]		, lowerCamelCase_    :List[str]		, lowerCamelCase_    :List[Any]		, lowerCamelCase_    :List[Any]=False					)							->			int:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     List[str]				= super()._prepare_for_class(a_		, a_		, return_labels=a_					)

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

			return inputs_dict





	def   __lowerCAmelCase (						self    :Union[str, Any]					)							->			Union[str, Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     int				= self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_model(*a_					)





	@unittest.skip(reason='''EfficientFormer does not implement masked image modeling yet'''					)
	def   __lowerCAmelCase (						self    :Optional[Any]					)							->			Optional[int]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Optional[Any]				= self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_masked_image_modeling(*a_					)





	def   __lowerCAmelCase (						self    :Dict					)							->			Optional[Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Any				= self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_image_classification(*a_					)





	@slow
	def   __lowerCAmelCase (						self    :Dict					)							->			Union[str, Any]:







			'''simple docstring'''




			for model_name in TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
					SCREAMING_SNAKE_CASE       :     Tuple				= TFEfficientFormerModel.from_pretrained(a_					)
					self.assertIsNotNone(a_					)





	def   __lowerCAmelCase (						self    :List[str]					)							->			str:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Any				= self.model_tester.prepare_config_and_inputs_for_common()
			SCREAMING_SNAKE_CASE       :     Tuple				= True

			SCREAMING_SNAKE_CASE       :     Tuple				= getattr(self.model_tester		, '''seq_length'''		, a_					)
			SCREAMING_SNAKE_CASE       :     List[Any]				= getattr(self.model_tester		, '''encoder_seq_length'''		, a_					)
			SCREAMING_SNAKE_CASE       :     Dict				= getattr(self.model_tester		, '''key_length'''		, a_					)
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= getattr(self.model_tester		, '''chunk_length'''		, a_					)

			if chunk_length is not None and hasattr(self.model_tester		, '''num_hashes'''					):
					SCREAMING_SNAKE_CASE       :     Optional[int]				= encoder_seq_length * self.model_tester.num_hashes

			for model_class in self.all_model_classes:
					SCREAMING_SNAKE_CASE       :     Union[str, Any]				= True
					SCREAMING_SNAKE_CASE       :     Optional[int]				= False
					SCREAMING_SNAKE_CASE       :     Dict				= True
					SCREAMING_SNAKE_CASE       :     str				= model_class(a_					)

					SCREAMING_SNAKE_CASE       :     Dict				= model(**self._prepare_for_class(a_		, a_					)		, training=a_					)
					SCREAMING_SNAKE_CASE       :     Any				= outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
					self.assertEqual(len(a_					)		, self.model_tester.num_attention_outputs					)

					# check that output_attentions also work using config
					del inputs_dict["output_attentions"]
					SCREAMING_SNAKE_CASE       :     Optional[int]				= True
					SCREAMING_SNAKE_CASE       :     Any				= model_class(a_					)
					SCREAMING_SNAKE_CASE       :     str				= model(**self._prepare_for_class(a_		, a_					)		, training=a_					)

					SCREAMING_SNAKE_CASE       :     List[str]				= outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
					self.assertEqual(len(a_					)		, 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   __lowerCAmelCase (						self    :str					)							->			Dict:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Dict				= self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
					# Prepare our model
					SCREAMING_SNAKE_CASE       :     Optional[int]				= model_class(a_					)
					# These are maximally general inputs for the model, with multiple None dimensions
					# Hopefully this will catch any conditionals that fail for flexible shapes
					SCREAMING_SNAKE_CASE       :     Optional[Any]				= {
					    key: tf.keras.Input(shape=val.shape[1:]		, dtype=val.dtype		, name=a_					)
					    for key, val in model.input_signature.items()
					    if key in model.dummy_inputs
					}
					SCREAMING_SNAKE_CASE       :     List[str]				= model(a_					)
					self.assertTrue(outputs_dict is not None					)





def __A						(   )->							Dict:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     Dict				= Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''     )
		return image




@require_tf
@require_vision
class 				lowercase__(				unittest.TestCase   ):
	'''simple docstring'''

	@cached_property
	def   __lowerCAmelCase (						self    :str					)							->			int:







			'''simple docstring'''




			return (
			    EfficientFormerImageProcessor.from_pretrained('''snap-research/efficientformer-l1-300'''					)
			    if is_vision_available()
			    else None
			)





	@slow
	def   __lowerCAmelCase (						self    :Union[str, Any]					)							->			Optional[int]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= TFEfficientFormerForImageClassification.from_pretrained('''snap-research/efficientformer-l1-300'''					)
			SCREAMING_SNAKE_CASE       :     List[str]				= self.default_image_processor
			SCREAMING_SNAKE_CASE       :     Tuple				= prepare_img()
			SCREAMING_SNAKE_CASE       :     str				= image_processor(images=a_		, return_tensors='''tf'''					)
			# forward pass
			SCREAMING_SNAKE_CASE       :     Any				= model(**a_		, training=a_					)
			# verify the logits
			SCREAMING_SNAKE_CASE       :     Optional[Any]				= tf.TensorShape((1, 10_00)					)
			self.assertEqual(outputs.logits.shape		, a_					)
			SCREAMING_SNAKE_CASE       :     Any				= tf.constant([-0.0_5_5_5, 0.4_8_2_5, -0.0_8_5_2]					)
			self.assertTrue(np.allclose(outputs.logits[0, :3]		, a_		, atol=1E-4					)					)







	@slow
	def   __lowerCAmelCase (						self    :str					)							->			List[Any]:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Optional[Any]				= TFEfficientFormerForImageClassificationWithTeacher.from_pretrained(
			    '''snap-research/efficientformer-l1-300'''					)
			SCREAMING_SNAKE_CASE       :     List[str]				= self.default_image_processor
			SCREAMING_SNAKE_CASE       :     int				= prepare_img()
			SCREAMING_SNAKE_CASE       :     Optional[int]				= image_processor(images=a_		, return_tensors='''tf'''					)
			# forward pass
			SCREAMING_SNAKE_CASE       :     int				= model(**a_		, training=a_					)
			# verify the logits
			SCREAMING_SNAKE_CASE       :     Dict				= tf.TensorShape((1, 10_00)					)
			self.assertEqual(outputs.logits.shape		, a_					)
			SCREAMING_SNAKE_CASE       :     List[str]				= tf.constant([-0.1_3_1_2, 0.4_3_5_3, -1.0_4_9_9]					)
			self.assertTrue(np.allclose(outputs.logits[0, :3]		, a_		, atol=1E-4					)					)







"""simple docstring"""






from typing import TYPE_CHECKING

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


lowerCamelCase__ :       Optional[Any]						     =			{
    "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"],
    "convert_funnel_original_tf_checkpoint_to_pytorch": [],
    "tokenization_funnel": ["FunnelTokenizer"],
}

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Optional[Any]						     =			["FunnelTokenizerFast"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Dict						     =			[
					    "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "FunnelBaseModel",
					    "FunnelForMaskedLM",
					    "FunnelForMultipleChoice",
					    "FunnelForPreTraining",
					    "FunnelForQuestionAnswering",
					    "FunnelForSequenceClassification",
					    "FunnelForTokenClassification",
					    "FunnelModel",
					    "FunnelPreTrainedModel",
					    "load_tf_weights_in_funnel",
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Tuple						     =			[
					    "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "TFFunnelBaseModel",
					    "TFFunnelForMaskedLM",
					    "TFFunnelForMultipleChoice",
					    "TFFunnelForPreTraining",
					    "TFFunnelForQuestionAnswering",
					    "TFFunnelForSequenceClassification",
					    "TFFunnelForTokenClassification",
					    "TFFunnelModel",
					    "TFFunnelPreTrainedModel",
					]


if TYPE_CHECKING:
					from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
					from .tokenization_funnel import FunnelTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_funnel_fast import FunnelTokenizerFast

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_funnel import (
										    FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    FunnelBaseModel,
										    FunnelForMaskedLM,
										    FunnelForMultipleChoice,
										    FunnelForPreTraining,
										    FunnelForQuestionAnswering,
										    FunnelForSequenceClassification,
										    FunnelForTokenClassification,
										    FunnelModel,
										    FunnelPreTrainedModel,
										    load_tf_weights_in_funnel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_funnel import (
										    TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFFunnelBaseModel,
										    TFFunnelForMaskedLM,
										    TFFunnelForMultipleChoice,
										    TFFunnelForPreTraining,
										    TFFunnelForQuestionAnswering,
										    TFFunnelForSequenceClassification,
										    TFFunnelForTokenClassification,
										    TFFunnelModel,
										    TFFunnelPreTrainedModel,
										)

else:
					import sys

					lowerCamelCase__ :       Optional[int]						     =			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





