

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


UpperCAmelCase__       =	logging.get_logger(__name__)







class       __lowerCAmelCase   (      UpperCamelCase__						):
			UpperCamelCase        =					'''upernet'''



			def __init__(						self       :  Dict			,		A       :  Optional[int]=None			,		A       :  Dict=5_12			,		A       :  List[Any]=0.0_2			,		A       :  List[Any]=[1, 2, 3, 6]			,		A       :  Tuple=True			,		A       :  Optional[int]=0.4			,		A       :  int=3_84			,		A       :  Optional[int]=2_56			,		A       :  Tuple=1			,		A       :  Dict=False			,		A       :  int=2_55			,		**A       :  Union[str, Any]			,		)       ->   List[Any]:



						"""simple docstring"""






						super().__init__(**UpperCamelCase_)

						if backbone_config is None:
									logger.info('`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.')
									_UpperCAmelCase			=       CONFIG_MAPPING['resnet'](out_features=['stage1', 'stage2', 'stage3', 'stage4'])
						elif isinstance(UpperCamelCase_			,		UpperCamelCase_):
									_UpperCAmelCase			=       backbone_config.get('model_type')
									_UpperCAmelCase			=       CONFIG_MAPPING[backbone_model_type]
									_UpperCAmelCase			=       config_class.from_dict(UpperCamelCase_)

						_UpperCAmelCase			=       backbone_config
						_UpperCAmelCase			=       hidden_size
						_UpperCAmelCase			=       initializer_range
						_UpperCAmelCase			=       pool_scales
						_UpperCAmelCase			=       use_auxiliary_head
						_UpperCAmelCase			=       auxiliary_loss_weight
						_UpperCAmelCase			=       auxiliary_in_channels
						_UpperCAmelCase			=       auxiliary_channels
						_UpperCAmelCase			=       auxiliary_num_convs
						_UpperCAmelCase			=       auxiliary_concat_input
						_UpperCAmelCase			=       loss_ignore_index



			def    _lowerCamelCase	(						self       :  Any)       ->   Tuple:



						"""simple docstring"""






						_UpperCAmelCase			=       copy.deepcopy(self.__dict__)
						_UpperCAmelCase			=       self.backbone_config.to_dict()
						_UpperCAmelCase			=       self.__class__.model_type
						return output





from typing import TYPE_CHECKING

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


UpperCAmelCase__       =	{
    "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"],
    "tokenization_deberta": ["DebertaTokenizer"],
}

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

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "DebertaForMaskedLM",
							    "DebertaForQuestionAnswering",
							    "DebertaForSequenceClassification",
							    "DebertaForTokenClassification",
							    "DebertaModel",
							    "DebertaPreTrainedModel",
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TFDebertaForMaskedLM",
							    "TFDebertaForQuestionAnswering",
							    "TFDebertaForSequenceClassification",
							    "TFDebertaForTokenClassification",
							    "TFDebertaModel",
							    "TFDebertaPreTrainedModel",
							]


if TYPE_CHECKING:
							from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig
							from .tokenization_deberta import DebertaTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_deberta_fast import DebertaTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_deberta import (
														    DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DebertaForMaskedLM,
														    DebertaForQuestionAnswering,
														    DebertaForSequenceClassification,
														    DebertaForTokenClassification,
														    DebertaModel,
														    DebertaPreTrainedModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_deberta import (
														    TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFDebertaForMaskedLM,
														    TFDebertaForQuestionAnswering,
														    TFDebertaForSequenceClassification,
														    TFDebertaForTokenClassification,
														    TFDebertaModel,
														    TFDebertaPreTrainedModel,
														)


else:
							import sys

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