



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


snake_case     :    Optional[Any]						=    logging.get_logger(__name__)

snake_case     :    Any						=    {
    '''MBZUAI/swiftformer-xs''': '''https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json''',
}




class 				lowerCAmelCase__	(						lowerCAmelCase__    ):
					__A  :     Union[str, Any]     =    'swiftformer'







					def __init__(							self   :  Optional[Any]      ,		_A   :  Tuple=3      ,		_A   :  Optional[Any]=[3, 3, 6, 4]      ,		_A   :  Union[str, Any]=[48, 56, 112, 220]      ,		_A   :  Optional[Any]=4      ,		_A   :  Optional[Any]=[True, True, True, True]      ,		_A   :  str="gelu"      ,		_A   :  Any=3      ,		_A   :  Optional[int]=2      ,		_A   :  Optional[Any]=1      ,		_A   :  List[Any]=0.0      ,		_A   :  Optional[int]=True      ,		_A   :  List[str]=1e-5      ,		_A   :  Optional[Any]=1e-5      ,		**_A   :  Tuple      ,		):
											super().__init__(**lowercase__)
											A__						:				Any         =			num_channels
											A__						:				Optional[Any]         =			depths
											A__						:				Dict         =			embed_dims
											A__						:				Optional[int]         =			mlp_ratio
											A__						:				Dict         =			downsamples
											A__						:				List[Any]         =			hidden_act
											A__						:				Union[str, Any]         =			down_patch_size
											A__						:				Optional[int]         =			down_stride
											A__						:				Optional[int]         =			down_pad
											A__						:				List[Any]         =			drop_path_rate
											A__						:				Optional[int]         =			use_layer_scale
											A__						:				str         =			layer_scale_init_value
											A__						:				Dict         =			batch_norm_eps




class 				lowerCAmelCase__	(						lowerCAmelCase__    ):
					__A  :     Union[str, Any]     =    version.parse('1.11'    )







					@property
					def 			_lowercase      (							self   :  Any):
											return OrderedDict(
											    [
											        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
											    ])







					@property
					def 			_lowercase      (							self   :  Union[str, Any]):
											return 1e-4







from typing import TYPE_CHECKING

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


snake_case_   :	Union[str, Any]							      ={'''configuration_gptj''': ['''GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTJConfig''', '''GPTJOnnxConfig''']}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	int							      =[
					    '''GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''GPTJForCausalLM''',
					    '''GPTJForQuestionAnswering''',
					    '''GPTJForSequenceClassification''',
					    '''GPTJModel''',
					    '''GPTJPreTrainedModel''',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	str							      =[
					    '''TFGPTJForCausalLM''',
					    '''TFGPTJForQuestionAnswering''',
					    '''TFGPTJForSequenceClassification''',
					    '''TFGPTJModel''',
					    '''TFGPTJPreTrainedModel''',
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					snake_case_   :	List[Any]							      =[
					    '''FlaxGPTJForCausalLM''',
					    '''FlaxGPTJModel''',
					    '''FlaxGPTJPreTrainedModel''',
					]


if TYPE_CHECKING:
					from .configuration_gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig, GPTJOnnxConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_gptj import (
										    GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST,
										    GPTJForCausalLM,
										    GPTJForQuestionAnswering,
										    GPTJForSequenceClassification,
										    GPTJModel,
										    GPTJPreTrainedModel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_gptj import (
										    TFGPTJForCausalLM,
										    TFGPTJForQuestionAnswering,
										    TFGPTJForSequenceClassification,
										    TFGPTJModel,
										    TFGPTJPreTrainedModel,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_gptj import FlaxGPTJForCausalLM, FlaxGPTJModel, FlaxGPTJPreTrainedModel

else:
					import sys

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

