


'''simple docstring'''

import copy

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


a_  :    Dict      =			logging.get_logger(__name__)





class 					snake_case   (   lowercase      ):





  """simple docstring"""




  _lowerCamelCase		   =  "vision-text-dual-encoder"
  _lowerCamelCase		   =  True






  def __init__(   self      ,  UpperCamelCase=512      ,  UpperCamelCase=2.6_592      ,  **UpperCamelCase					):







   """simple docstring"""
   super().__init__(**UpperCamelCase					)

   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_								=  kwargs.pop("vision_config"					)
   lowerCamelCase_								=  kwargs.pop("text_config"					)

   lowerCamelCase_								=  vision_config.pop("model_type"					)
   lowerCamelCase_								=  text_config.pop("model_type"					)

   if vision_model_type == "clip":
    lowerCamelCase_								=  AutoConfig.for_model(UpperCamelCase      ,  **UpperCamelCase					).vision_config
   elif vision_model_type == "clip_vision_model":
    lowerCamelCase_								=  CLIPVisionConfig(**UpperCamelCase					)
   else:
    lowerCamelCase_								=  AutoConfig.for_model(UpperCamelCase      ,  **UpperCamelCase					)

   lowerCamelCase_								=  AutoConfig.for_model(UpperCamelCase      ,  **UpperCamelCase					)

   lowerCamelCase_								=  projection_dim
   lowerCamelCase_								=  logit_scale_init_value






  @classmethod
  def   snake_case		(   cls      ,  UpperCamelCase      ,  UpperCamelCase      ,  **UpperCamelCase					):







   """simple docstring"""
   return cls(vision_config=vision_config.to_dict()      ,  text_config=text_config.to_dict()      ,  **UpperCamelCase					)







  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  copy.deepcopy(self.__dict__					)
   lowerCamelCase_								=  self.vision_config.to_dict()
   lowerCamelCase_								=  self.text_config.to_dict()
   lowerCamelCase_								=  self.__class__.model_type
   return output







'''simple docstring'''

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


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

a_  :    int      =			{
    """uw-madison/nystromformer-512""": """https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json""",
    # See all Nystromformer models at https://huggingface.co/models?filter=nystromformer
}





class 					snake_case   (   lowercase      ):





  """simple docstring"""




  _lowerCamelCase		   =  "nystromformer"






  def __init__(   self      ,  UpperCamelCase=3_0000      ,  UpperCamelCase=768      ,  UpperCamelCase=12      ,  UpperCamelCase=12      ,  UpperCamelCase=3072      ,  UpperCamelCase="gelu_new"      ,  UpperCamelCase=0.1      ,  UpperCamelCase=0.1      ,  UpperCamelCase=510      ,  UpperCamelCase=2      ,  UpperCamelCase=64      ,  UpperCamelCase=64      ,  UpperCamelCase=65      ,  UpperCamelCase=False      ,  UpperCamelCase=0.02      ,  UpperCamelCase=1e-5      ,  UpperCamelCase=1      ,  UpperCamelCase=0      ,  UpperCamelCase=2      ,  **UpperCamelCase      ,  ):







   """simple docstring"""
   lowerCamelCase_								=  vocab_size
   lowerCamelCase_								=  max_position_embeddings
   lowerCamelCase_								=  hidden_size
   lowerCamelCase_								=  num_hidden_layers
   lowerCamelCase_								=  num_attention_heads
   lowerCamelCase_								=  intermediate_size
   lowerCamelCase_								=  hidden_act
   lowerCamelCase_								=  hidden_dropout_prob
   lowerCamelCase_								=  attention_probs_dropout_prob
   lowerCamelCase_								=  initializer_range
   lowerCamelCase_								=  type_vocab_size
   lowerCamelCase_								=  segment_means_seq_len
   lowerCamelCase_								=  num_landmarks
   lowerCamelCase_								=  conv_kernel_size
   lowerCamelCase_								=  inv_coeff_init_option
   lowerCamelCase_								=  layer_norm_eps
   super().__init__(pad_token_id=UpperCamelCase      ,  bos_token_id=UpperCamelCase      ,  eos_token_id=UpperCamelCase      ,  **UpperCamelCase					)



