



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


lowerCamelCase__			= logging.get_logger(__name__)

lowerCamelCase__			= {
    """sail/poolformer_s12""": """https://huggingface.co/sail/poolformer_s12/resolve/main/config.json""",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}






class    SCREAMING_SNAKE_CASE			(							lowerCamelCase__					):
							__lowerCamelCase	:	List[str]    ='poolformer'





							def __init__(   self		:		Optional[Any]      ,				__lowercase		:		str=3      ,				__lowercase		:		List[str]=16      ,				__lowercase		:		List[Any]=16      ,				__lowercase		:		Optional[int]=3      ,				__lowercase		:		Dict=4.0      ,				__lowercase		:		Optional[Any]=[2, 2, 6, 2]      ,				__lowercase		:		List[Any]=[64, 128, 320, 512]      ,				__lowercase		:		List[str]=[7, 3, 3, 3]      ,				__lowercase		:		Union[str, Any]=[4, 2, 2, 2]      ,				__lowercase		:		str=[2, 1, 1, 1]      ,				__lowercase		:		List[str]=4      ,				__lowercase		:		Any=0.0      ,				__lowercase		:		Tuple="gelu"      ,				__lowercase		:		List[Any]=True      ,				__lowercase		:		Dict=1E-5      ,				__lowercase		:		List[Any]=0.02      ,				**__lowercase		:		int      ,				):

											'''simple docstring'''
											__a       =		num_channels
											__a       =		patch_size
											__a       =		stride
											__a       =		padding
											__a       =		pool_size
											__a       =		hidden_sizes
											__a       =		mlp_ratio
											__a       =		depths
											__a       =		patch_sizes
											__a       =		strides
											__a       =		num_encoder_blocks
											__a       =		drop_path_rate
											__a       =		hidden_act
											__a       =		use_layer_scale
											__a       =		layer_scale_init_value
											__a       =		initializer_range
											super().__init__(**__lowercase	)






class    SCREAMING_SNAKE_CASE			(							lowerCamelCase__					):
							__lowerCamelCase	:	int    =version.parse('1.11'					)





							@property
							def 						UpperCamelCase_					(   self		:		str	):

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







							@property
							def 						UpperCamelCase_					(   self		:		Union[str, Any]	):

											'''simple docstring'''
											return 2E-3





from typing import TYPE_CHECKING

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


lowerCamelCase__			= {"""configuration_mbart""": ["""MBART_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MBartConfig""", """MBartOnnxConfig"""]}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= ["""MBartTokenizer"""]

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

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """MBART_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """MBartForCausalLM""",
						    """MBartForConditionalGeneration""",
						    """MBartForQuestionAnswering""",
						    """MBartForSequenceClassification""",
						    """MBartModel""",
						    """MBartPreTrainedModel""",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """TFMBartForConditionalGeneration""",
						    """TFMBartModel""",
						    """TFMBartPreTrainedModel""",
						]

try:
						if not is_flax_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """FlaxMBartForConditionalGeneration""",
						    """FlaxMBartForQuestionAnswering""",
						    """FlaxMBartForSequenceClassification""",
						    """FlaxMBartModel""",
						    """FlaxMBartPreTrainedModel""",
						]


if TYPE_CHECKING:
						from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_mbart import MBartTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_mbart_fast import MBartTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mbart import (
												    MBART_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MBartForCausalLM,
												    MBartForConditionalGeneration,
												    MBartForQuestionAnswering,
												    MBartForSequenceClassification,
												    MBartModel,
												    MBartPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_mbart import TFMBartForConditionalGeneration, TFMBartModel, TFMBartPreTrainedModel

						try:
												if not is_flax_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flax_mbart import (
												    FlaxMBartForConditionalGeneration,
												    FlaxMBartForQuestionAnswering,
												    FlaxMBartForSequenceClassification,
												    FlaxMBartModel,
												    FlaxMBartPreTrainedModel,
												)

else:
						import sys

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