


from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_lowercase       :      Tuple	=	logging.get_logger(__name__)

_lowercase       :      Optional[int]	=	{
    "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json",
    "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json",
    "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json",
    # See all BigBird models at https://huggingface.co/models?filter=big_bird
}






class       _UpperCamelCase    (					_UpperCamelCase				):

				"""simple docstring"""







				lowerCAmelCase 		= 'big_bird'

				def __init__(						self				,   a__=5_0358				,   a__=768				,   a__=12				,   a__=12				,   a__=3072				,   a__="gelu_new"				,   a__=0.1				,   a__=0.1				,   a__=4096				,   a__=2				,   a__=0.02				,   a__=1e-12				,   a__=True				,   a__=0				,   a__=1				,   a__=2				,   a__=66				,   a__="block_sparse"				,   a__=True				,   a__=False				,   a__=64				,   a__=3				,   a__=None				,   **a__				,   )	->				int:
					super().__init__(
					    pad_token_id=a__				,   bos_token_id=a__				,   eos_token_id=a__				,   sep_token_id=a__				,   **a__				,   )

					A								=				vocab_size
					A								=				max_position_embeddings
					A								=				hidden_size
					A								=				num_hidden_layers
					A								=				num_attention_heads
					A								=				intermediate_size
					A								=				hidden_act
					A								=				hidden_dropout_prob
					A								=				attention_probs_dropout_prob
					A								=				initializer_range
					A								=				type_vocab_size
					A								=				layer_norm_eps
					A								=				use_cache

					A								=				rescale_embeddings
					A								=				attention_type
					A								=				use_bias
					A								=				block_size
					A								=				num_random_blocks
					A								=				classifier_dropout






class       _UpperCamelCase    (					_UpperCamelCase				):

				"""simple docstring"""







				@property
				def      _UpperCAmelCase					(						self   )	->				Union[str, Any]:
					if self.task == "multiple-choice":
						A								=				{0: "batch", 1: "choice", 2: "sequence"}
					else:
						A								=				{0: "batch", 1: "sequence"}
					return OrderedDict(
					    [
					        ("""input_ids""", dynamic_axis),
					        ("""attention_mask""", dynamic_axis),
					    ]   )







import copy

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


_lowercase       :      int	=	logging.get_logger(__name__)






class       _UpperCamelCase    (					__snake_case				):

				"""simple docstring"""







				lowerCAmelCase 		= 'upernet'

				def __init__(						self				,   a__=None				,   a__=512				,   a__=0.02				,   a__=[1, 2, 3, 6]				,   a__=True				,   a__=0.4				,   a__=384				,   a__=256				,   a__=1				,   a__=False				,   a__=255				,   **a__				,   )	->				Tuple:
					super().__init__(**a__   )

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

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

				def      _UpperCAmelCase					(						self   )	->				Dict:
					A								=				copy.deepcopy(self.__dict__   )
					A								=				self.backbone_config.to_dict()
					A								=				self.__class__.model_type
					return output



