

import warnings
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_ :				int						 =    logging.get_logger(__name__)

A_ :				str						 =    {
    'nvidia/segformer-b0-finetuned-ade-512-512': (
        'https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json'
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}



class 					_a		(__A       ):


					'''simple docstring'''






					UpperCAmelCase__:     Optional[int]													= '''segformer'''






					def __init__(				self					, A__=3					, A__=4					, A__=[2, 2, 2, 2]					, A__=[8, 4, 2, 1]					, A__=[32, 64, 160, 256]					, A__=[7, 3, 3, 3]					, A__=[4, 2, 2, 2]					, A__=[1, 2, 5, 8]					, A__=[4, 4, 4, 4]					, A__="gelu"					, A__=0.0					, A__=0.0					, A__=0.1					, A__=0.0_2					, A__=0.1					, A__=1e-6					, A__=256					, A__=255					, **A__					, ):
						super().__init__(**A__    )

						if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
							warnings.warn(
							    """Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be"""
							    """ removed, as the behaviour will default to that of reshape_last_stage = True."""					, A__					, )

						A__							:					Optional[int]       =	num_channels
						A__							:					int       =	num_encoder_blocks
						A__							:					Optional[int]       =	depths
						A__							:					Optional[int]       =	sr_ratios
						A__							:					int       =	hidden_sizes
						A__							:					List[str]       =	patch_sizes
						A__							:					Any       =	strides
						A__							:					Union[str, Any]       =	mlp_ratios
						A__							:					str       =	num_attention_heads
						A__							:					List[str]       =	hidden_act
						A__							:					Any       =	hidden_dropout_prob
						A__							:					Optional[Any]       =	attention_probs_dropout_prob
						A__							:					Union[str, Any]       =	classifier_dropout_prob
						A__							:					Dict       =	initializer_range
						A__							:					Any       =	drop_path_rate
						A__							:					Dict       =	layer_norm_eps
						A__							:					Optional[int]       =	decoder_hidden_size
						A__							:					Any       =	kwargs.get("""reshape_last_stage"""					, A__    )
						A__							:					Tuple       =	semantic_loss_ignore_index



class 					_a		(__A       ):


					'''simple docstring'''






					UpperCAmelCase__:     List[str]													= version.parse('''1.11'''       )






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






					@property
					def 						__A    (				self    ):
						return 1e-4






					@property
					def 						__A    (				self    ):
						return 12






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


A_ :				Optional[Any]						 =    {}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A_ :				str						 =    ['BartphoTokenizer']

if TYPE_CHECKING:
	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_bartpho import BartphoTokenizer

else:
	import sys

	A_ :				Optional[int]						 =    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



