






from collections import OrderedDict
from typing import Mapping

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


A__      :     Dict       =					logging.get_logger(__name__)

A__      :     Tuple       =					{
    '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   (			A__      ):

				"""simple docstring"""




				lowercase__											=			"""big_bird"""




				def __init__(	self		:       Any,    lowerCamelCase		:       int=50_358,    lowerCamelCase		:       Dict=768,    lowerCamelCase		:       int=12,    lowerCamelCase		:       List[str]=12,    lowerCamelCase		:       Optional[Any]=3_072,    lowerCamelCase		:       Optional[int]="gelu_new",    lowerCamelCase		:       Optional[int]=0.1,    lowerCamelCase		:       str=0.1,    lowerCamelCase		:       Tuple=4_096,    lowerCamelCase		:       List[str]=2,    lowerCamelCase		:       Any=0.02,    lowerCamelCase		:       List[Any]=1E-12,    lowerCamelCase		:       List[str]=True,    lowerCamelCase		:       str=0,    lowerCamelCase		:       str=1,    lowerCamelCase		:       List[Any]=2,    lowerCamelCase		:       int=66,    lowerCamelCase		:       List[str]="block_sparse",    lowerCamelCase		:       Any=True,    lowerCamelCase		:       Tuple=False,    lowerCamelCase		:       int=64,    lowerCamelCase		:       Optional[int]=3,    lowerCamelCase		:       Tuple=None,    **lowerCamelCase		:       str,    ):

								'''simple docstring'''
								super().__init__(
								    pad_token_id=lowerCamelCase,    bos_token_id=lowerCamelCase,    eos_token_id=lowerCamelCase,    sep_token_id=lowerCamelCase,    **lowerCamelCase,    )

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

								lowercase__  					=     rescale_embeddings
								lowercase__  					=     attention_type
								lowercase__  					=     use_bias
								lowercase__  					=     block_size
								lowercase__  					=     num_random_blocks
								lowercase__  					=     classifier_dropout



class  _UpperCAmelCase   (			A__      ):

				"""simple docstring"""




				@property
				def 							lowercase__  (	self		:       Dict    ):

								'''simple docstring'''
								if self.task == "multiple-choice":
												lowercase__  					=     {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
								else:
												lowercase__  					=     {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


A__      :     Tuple       =					logging.get_logger(__name__)
class  _UpperCAmelCase   (			A__      ):

				"""simple docstring"""




				lowercase__											=			"""upernet"""




				def __init__(	self		:       Dict,    lowerCamelCase		:       Union[str, Any]=None,    lowerCamelCase		:       str=512,    lowerCamelCase		:       Optional[Any]=0.02,    lowerCamelCase		:       Optional[Any]=[1, 2, 3, 6],    lowerCamelCase		:       Optional[int]=True,    lowerCamelCase		:       Tuple=0.4,    lowerCamelCase		:       Optional[int]=384,    lowerCamelCase		:       Optional[int]=256,    lowerCamelCase		:       Dict=1,    lowerCamelCase		:       str=False,    lowerCamelCase		:       List[str]=255,    **lowerCamelCase		:       List[Any],    ):

								'''simple docstring'''
								super().__init__(**lowerCamelCase    )

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

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




				def 							lowercase__  (	self		:       str    ):

								'''simple docstring'''
								lowercase__  					=     copy.deepcopy(self.__dict__    )
								lowercase__  					=     self.backbone_config.to_dict()
								lowercase__  					=     self.__class__.model_type
								return output




