
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__		:str   =    logging.get_logger(__name__)

lowercase__		:Tuple   =    {
    "facebook/dpr-ctx_encoder-single-nq-base": (
        "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json"
    ),
    "facebook/dpr-question_encoder-single-nq-base": (
        "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json"
    ),
    "facebook/dpr-reader-single-nq-base": (
        "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json"
    ),
    "facebook/dpr-ctx_encoder-multiset-base": (
        "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json"
    ),
    "facebook/dpr-question_encoder-multiset-base": (
        "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json"
    ),
    "facebook/dpr-reader-multiset-base": (
        "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json"
    ),
}







class 				lowercase		(					SCREAMING_SNAKE_CASE__		):
							lowercase_       :       Tuple       					='''dpr'''




							def __init__(				self   ,A__=3_0_5_2_2   ,A__=7_6_8   ,A__=1_2   ,A__=1_2   ,A__=3_0_7_2   ,A__="gelu"   ,A__=0.1   ,A__=0.1   ,A__=5_1_2   ,A__=2   ,A__=0.02   ,A__=1E-12   ,A__=0   ,A__="absolute"   ,A__ = 0   ,**A__   ,):
												super().__init__(pad_token_id=A__   ,**A__)

												lowercase							=						vocab_size
												lowercase							=						hidden_size
												lowercase							=						num_hidden_layers
												lowercase							=						num_attention_heads
												lowercase							=						hidden_act
												lowercase							=						intermediate_size
												lowercase							=						hidden_dropout_prob
												lowercase							=						attention_probs_dropout_prob
												lowercase							=						max_position_embeddings
												lowercase							=						type_vocab_size
												lowercase							=						initializer_range
												lowercase							=						layer_norm_eps
												lowercase							=						projection_dim
												lowercase							=						position_embedding_type






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


_lowerCamelCase					   =logging.get_logger(__name__)

_lowerCamelCase					   ={
    """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__		(	__SCREAMING_SNAKE_CASE):
      _UpperCAmelCase				:    Dict           =			"""segformer"""
      def __init__(      self    ,  __magic_name__=3    ,  __magic_name__=4    ,  __magic_name__=[2, 2, 2, 2]    ,  __magic_name__=[8, 4, 2, 1]    ,  __magic_name__=[3_2, 6_4, 1_6_0, 2_5_6]    ,  __magic_name__=[7, 3, 3, 3]    ,  __magic_name__=[4, 2, 2, 2]    ,  __magic_name__=[1, 2, 5, 8]    ,  __magic_name__=[4, 4, 4, 4]    ,  __magic_name__="gelu"    ,  __magic_name__=0.0    ,  __magic_name__=0.0    ,  __magic_name__=0.1    ,  __magic_name__=0.02    ,  __magic_name__=0.1    ,  __magic_name__=1e-6    ,  __magic_name__=2_5_6    ,  __magic_name__=2_5_5    ,  **__magic_name__    ,  ):
       super().__init__(**__magic_name__      )

       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."""    ,  __magic_name__    ,  )

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





class 							A__		(	__SCREAMING_SNAKE_CASE):
      _UpperCAmelCase				:    str           =			version.parse("""1.11""")
      @property
      def 						UpperCamelCase__							(      self      ):
       return OrderedDict(
           [
               ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
           ]      )
      @property
      def 						UpperCamelCase__							(      self      ):
       return 1e-4






      @property
      def 						UpperCamelCase__							(      self      ):
       return 1_2




