
"""simple docstring"""





from typing import TYPE_CHECKING

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


_a														=		{
    """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:
				_a														=		["""FunnelTokenizerFast"""]

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_a														=		[
				    """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:
				_a														=		[
				    """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

				_a														=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)








"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_a														=		logging.get_logger(__name__)

_a														=		{
    """facebook/levit-128S""": """https://huggingface.co/facebook/levit-128S/resolve/main/config.json""",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}






class    _UpperCAmelCase(   lowerCamelCase     ):
		lowercase__      =				'levit'



		def __init__( self    ,		__a=2_24    ,		__a=3    ,		__a=3    ,		__a=2    ,		__a=1    ,		__a=16    ,		__a=[1_28, 2_56, 3_84]    ,		__a=[4, 8, 12]    ,		__a=[4, 4, 4]    ,		__a=[16, 16, 16]    ,		__a=0    ,		__a=[2, 2, 2]    ,		__a=[2, 2, 2]    ,		__a=0.02    ,		**__a    ,		)	->	List[str]:






							'''simple docstring'''
							super().__init__(**__a)
							_UpperCamelCase										=  image_size
							_UpperCamelCase										=  num_channels
							_UpperCamelCase										=  kernel_size
							_UpperCamelCase										=  stride
							_UpperCamelCase										=  padding
							_UpperCamelCase										=  hidden_sizes
							_UpperCamelCase										=  num_attention_heads
							_UpperCamelCase										=  depths
							_UpperCamelCase										=  key_dim
							_UpperCamelCase										=  drop_path_rate
							_UpperCamelCase										=  patch_size
							_UpperCamelCase										=  attention_ratio
							_UpperCamelCase										=  mlp_ratio
							_UpperCamelCase										=  initializer_range
							_UpperCamelCase										=  [
							    ['''Subsample''', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
							    ['''Subsample''', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
							]






class    _UpperCAmelCase(   lowerCamelCase     ):
		lowercase__      =				version.parse('1.11'     )



		@property
		def 						UpperCAmelCase							( self)	->	Mapping[str, Mapping[int, str]]:






							'''simple docstring'''
							return OrderedDict(
							    [
							        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
							    ])




		@property
		def 						UpperCAmelCase							( self)	->	float:






							'''simple docstring'''
							return 1e-4






