

import copy

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


SCREAMING_SNAKE_CASE		:List[Any]				  =    logging.get_logger(__name__)






class 	__magic_name__				(       snake_case							):
     UpperCamelCase_  :int								=			"""vision-text-dual-encoder"""
     UpperCamelCase_  :int								=			True






     def __init__(							self		,	_lowercase=512		,	_lowercase=2.6_592		,	**_lowercase  )->    List[str]:
         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`."  )

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

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

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

         UpperCamelCase_      =	AutoConfig.for_model(_lowercase		,	**_lowercase  )

         UpperCamelCase_      =	projection_dim
         UpperCamelCase_      =	logit_scale_init_value






     @classmethod
     def   UpperCAmelCase_							(							cls		,	_lowercase		,	_lowercase		,	**_lowercase  )->    List[Any]:
         return cls(vision_config=vision_config.to_dict()		,	text_config=text_config.to_dict()		,	**_lowercase  )






     def   UpperCAmelCase_							(							self  )->    Dict:
         UpperCamelCase_      =	copy.deepcopy(self.__dict__  )
         UpperCamelCase_      =	self.vision_config.to_dict()
         UpperCamelCase_      =	self.text_config.to_dict()
         UpperCamelCase_      =	self.__class__.model_type
         return output



def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ )->	str:



    """simple docstring"""






    if power < 0:
        return -1
    base %= mod
    UpperCamelCase_      =	1

    while power > 0:
        if power & 1:
            UpperCamelCase_      =	(result * base) % mod
        UpperCamelCase_      =	power >> 1
        UpperCamelCase_      =	(base * base) % mod

    return result




def  lowerCAmelCase(			)->	Tuple:



    """simple docstring"""






    print(modular_exponential(3 ,	2_0_0 ,	1_3 ) )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 main()
