



import copy

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


A_		:  str										=  logging.get_logger(__name__)



class 		_lowercase		(							UpperCAmelCase__						):
   _UpperCAmelCase  						=      '''vision-text-dual-encoder'''
   _UpperCAmelCase  						=      True

   def __init__(   self      :							Dict				, __lowerCAmelCase      :							Any=512				, __lowerCAmelCase      :							Any=2.6_5_9_2				, **__lowerCAmelCase      :							str				)							->					Optional[int]:


    """simple docstring"""






    super().__init__(**__lowerCAmelCase				)

    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`."				)

    a							=		kwargs.pop("vision_config"				)
    a							=		kwargs.pop("text_config"				)

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

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

    a							=		AutoConfig.for_model(__lowerCAmelCase				, **__lowerCAmelCase				)

    a							=		projection_dim
    a							=		logit_scale_init_value

   @classmethod
   def 		A				(   cls      :							str				, __lowerCAmelCase      :							PretrainedConfig				, __lowerCAmelCase      :							PretrainedConfig				, **__lowerCAmelCase      :							Optional[Any]				)							->					Union[str, Any]:


    """simple docstring"""






    return cls(vision_config=vision_config.to_dict()				, text_config=text_config.to_dict()				, **__lowerCAmelCase				)




   def 		A				(   self      :							str				)							->					int:


    """simple docstring"""






    a							=		copy.deepcopy(self.__dict__				)
    a							=		self.vision_config.to_dict()
    a							=		self.text_config.to_dict()
    a							=		self.__class__.model_type
    return output




def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       int:

 """simple docstring"""






 return n * (2 * n - 1)







def _a					(			SCREAMING_SNAKE_CASE						:     int						)       ->       bool:

 """simple docstring"""






 __lowerCAmelCase:  List[Any]        = (1 + 24 * n) ** 0.5
 return ((1 + root) / 6) % 1 == 0







def _a					(			SCREAMING_SNAKE_CASE						:     int = 1_44						)       ->       int:

 """simple docstring"""






 __lowerCAmelCase:  Dict        = start
 __lowerCAmelCase:  List[str]        = hexagonal_num(SCREAMING_SNAKE_CASE						)
 while not is_pentagonal(SCREAMING_SNAKE_CASE						):
  n += 1
  __lowerCAmelCase:  Any        = hexagonal_num(SCREAMING_SNAKE_CASE						)
 return num


if __name__ == "__main__":
  print(f"{solution()} = ")





