'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

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


lowerCAmelCase_			:			Union[str, Any]    	=   logging.get_logger(__name__)

lowerCAmelCase_			:			int    	=   {
    """google/electra-small-generator""": """https://huggingface.co/google/electra-small-generator/resolve/main/config.json""",
    """google/electra-base-generator""": """https://huggingface.co/google/electra-base-generator/resolve/main/config.json""",
    """google/electra-large-generator""": """https://huggingface.co/google/electra-large-generator/resolve/main/config.json""",
    """google/electra-small-discriminator""": (
        """https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json"""
    ),
    """google/electra-base-discriminator""": (
        """https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json"""
    ),
    """google/electra-large-discriminator""": (
        """https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json"""
    ),
}





class 				lowercase    (    __A			):
   lowerCamelCase_            ='electra'


   def __init__( self					:						Dict ,		__lowerCAmelCase					:						Tuple=3_0522 ,		__lowerCAmelCase					:						Optional[Any]=128 ,		__lowerCAmelCase					:						str=256 ,		__lowerCAmelCase					:						Union[str, Any]=12 ,		__lowerCAmelCase					:						List[Any]=4 ,		__lowerCAmelCase					:						Any=1024 ,		__lowerCAmelCase					:						Dict="gelu" ,		__lowerCAmelCase					:						List[str]=0.1 ,		__lowerCAmelCase					:						Optional[int]=0.1 ,		__lowerCAmelCase					:						Dict=512 ,		__lowerCAmelCase					:						List[str]=2 ,		__lowerCAmelCase					:						Any=0.02 ,		__lowerCAmelCase					:						str=1e-12 ,		__lowerCAmelCase					:						Dict="first" ,		__lowerCAmelCase					:						List[str]=True ,		__lowerCAmelCase					:						Tuple="gelu" ,		__lowerCAmelCase					:						Union[str, Any]=0.1 ,		__lowerCAmelCase					:						Dict=0 ,		__lowerCAmelCase					:						Tuple="absolute" ,		__lowerCAmelCase					:						Dict=True ,		__lowerCAmelCase					:						List[str]=None ,		**__lowerCAmelCase					:						Union[str, Any] ,		)   ->       int:
         super().__init__(pad_token_id=_lowercase ,		**_lowercase)

         lowercase_     			=   vocab_size
         lowercase_     			=   embedding_size
         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_     			=   max_position_embeddings
         lowercase_     			=   type_vocab_size
         lowercase_     			=   initializer_range
         lowercase_     			=   layer_norm_eps

         lowercase_     			=   summary_type
         lowercase_     			=   summary_use_proj
         lowercase_     			=   summary_activation
         lowercase_     			=   summary_last_dropout
         lowercase_     			=   position_embedding_type
         lowercase_     			=   use_cache
         lowercase_     			=   classifier_dropout





class 				lowercase    (    __A			):


   @property
   def __UpperCAmelCase							( self					:						Optional[Any])   ->       int:
         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),
                 ("token_type_ids", dynamic_axis),
             ])













import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..clip.configuration_clip import CLIPVisionConfig


UpperCAmelCase_       : Union[str, Any]							=    logging.get_logger(__name__)





class   lowercase__     (				__A	):
  __UpperCamelCase						  =	"""vision-text-dual-encoder"""
  __UpperCamelCase						  =	True







  def __init__(						self     ,    _lowercase=512     ,    _lowercase=2.6592     ,    **_lowercase    ):
       super().__init__(**_lowercase    )

       if "vision_config" not in kwargs:
            raise ValueError("""`vision_config` can not be `None`."""    )

       if "text_config" not in kwargs:
            raise ValueError("""`text_config` can not be `None`."""    )

       lowerCAmelCase_       :							Dict			 =		kwargs.pop("""vision_config"""    )
       lowerCAmelCase_       :							Optional[int]			 =		kwargs.pop("""text_config"""    )

       lowerCAmelCase_       :							Tuple			 =		vision_config.pop("""model_type"""    )
       lowerCAmelCase_       :							str			 =		text_config.pop("""model_type"""    )

       if vision_model_type == "clip":
            lowerCAmelCase_       :							Dict			 =		AutoConfig.for_model(_lowercase     ,    **_lowercase    ).vision_config
       elif vision_model_type == "clip_vision_model":
            lowerCAmelCase_       :							Any			 =		CLIPVisionConfig(**_lowercase    )
       else:
            lowerCAmelCase_       :							Tuple			 =		AutoConfig.for_model(_lowercase     ,    **_lowercase    )

       lowerCAmelCase_       :							List[Any]			 =		AutoConfig.for_model(_lowercase     ,    **_lowercase    )

       lowerCAmelCase_       :							Union[str, Any]			 =		projection_dim
       lowerCAmelCase_       :							Optional[int]			 =		logit_scale_init_value







  @classmethod
  def 						UpperCAmelCase__		(						cls     ,    _lowercase     ,    _lowercase     ,    **_lowercase    ):
       return cls(vision_config=vision_config.to_dict()     ,    text_config=text_config.to_dict()     ,    **_lowercase    )







  def 						UpperCAmelCase__		(						self    ):
       lowerCAmelCase_       :							int			 =		copy.deepcopy(self.__dict__    )
       lowerCAmelCase_       :							List[str]			 =		self.vision_config.to_dict()
       lowerCAmelCase_       :							List[str]			 =		self.text_config.to_dict()
       lowerCAmelCase_       :							str			 =		self.__class__.model_type
       return output
