



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


UpperCAmelCase__       =	logging.get_logger(__name__)

UpperCAmelCase__       =	{
    "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json",
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}







class       __lowerCAmelCase   (      A						):
			UpperCamelCase        =					'''yolos'''



			def __init__(						self       :  Dict			,		A       :  Any=7_68			,		A       :  Tuple=12			,		A       :  Tuple=12			,		A       :  List[Any]=30_72			,		A       :  Dict="gelu"			,		A       :  Union[str, Any]=0.0			,		A       :  Optional[int]=0.0			,		A       :  Optional[Any]=0.0_2			,		A       :  Any=1E-12			,		A       :  Tuple=[5_12, 8_64]			,		A       :  List[Any]=16			,		A       :  List[Any]=3			,		A       :  Dict=True			,		A       :  Optional[int]=1_00			,		A       :  Any=True			,		A       :  Optional[int]=False			,		A       :  Union[str, Any]=1			,		A       :  Any=5			,		A       :  Optional[Any]=2			,		A       :  Union[str, Any]=5			,		A       :  Any=2			,		A       :  Dict=0.1			,		**A       :  str			,		)       ->   List[str]:



						"""simple docstring"""






						super().__init__(**A)

						_UpperCAmelCase			=       hidden_size
						_UpperCAmelCase			=       num_hidden_layers
						_UpperCAmelCase			=       num_attention_heads
						_UpperCAmelCase			=       intermediate_size
						_UpperCAmelCase			=       hidden_act
						_UpperCAmelCase			=       hidden_dropout_prob
						_UpperCAmelCase			=       attention_probs_dropout_prob
						_UpperCAmelCase			=       initializer_range
						_UpperCAmelCase			=       layer_norm_eps
						_UpperCAmelCase			=       image_size
						_UpperCAmelCase			=       patch_size
						_UpperCAmelCase			=       num_channels
						_UpperCAmelCase			=       qkv_bias
						_UpperCAmelCase			=       num_detection_tokens
						_UpperCAmelCase			=       use_mid_position_embeddings
						_UpperCAmelCase			=       auxiliary_loss
						# Hungarian matcher
						_UpperCAmelCase			=       class_cost
						_UpperCAmelCase			=       bbox_cost
						_UpperCAmelCase			=       giou_cost
						# Loss coefficients
						_UpperCAmelCase			=       bbox_loss_coefficient
						_UpperCAmelCase			=       giou_loss_coefficient
						_UpperCAmelCase			=       eos_coefficient







class       __lowerCAmelCase   (      A						):
			UpperCamelCase        =					version.parse('''1.11'''						)



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



						"""simple docstring"""






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



			@property
			def    _lowerCamelCase	(						self       :  Union[str, Any])       ->   float:



						"""simple docstring"""






						return 1E-4



			@property
			def    _lowerCamelCase	(						self       :  Any)       ->   int:



						"""simple docstring"""






						return 12





from typing import TYPE_CHECKING

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


UpperCAmelCase__       =	{
    "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "MegaForCausalLM",
							    "MegaForMaskedLM",
							    "MegaForMultipleChoice",
							    "MegaForQuestionAnswering",
							    "MegaForSequenceClassification",
							    "MegaForTokenClassification",
							    "MegaModel",
							    "MegaPreTrainedModel",
							]

if TYPE_CHECKING:
							from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mega import (
														    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MegaForCausalLM,
														    MegaForMaskedLM,
														    MegaForMultipleChoice,
														    MegaForQuestionAnswering,
														    MegaForSequenceClassification,
														    MegaForTokenClassification,
														    MegaModel,
														    MegaPreTrainedModel,
														)

else:
							import sys

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