

import copy

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


__A    	=			logging.get_logger(__name__)



class 						lowercase_					(						__lowercase  ):
      UpperCamelCase_    :	Optional[Any]		   =       "vision-text-dual-encoder"
      UpperCamelCase_    :	Optional[int]		   =       True



      def __init__(    self   :       Union[str, Any]    ,      A__   :       Any=512    ,      A__   :       int=2.6592    ,      **A__   :       str	)					->  Dict:
        super().__init__(**A__	)

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

        _snake_case		=							kwargs.pop('''vision_config'''	)
        _snake_case		=							kwargs.pop('''text_config'''	)

        _snake_case		=							vision_config.pop('''model_type'''	)
        _snake_case		=							text_config.pop('''model_type'''	)

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

        _snake_case		=							AutoConfig.for_model(A__    ,      **A__	)

        _snake_case		=							projection_dim
        _snake_case		=							logit_scale_init_value



      @classmethod
      def 		UpperCamelCase_	(    cls   :       Union[str, Any]    ,      A__   :       PretrainedConfig    ,      A__   :       PretrainedConfig    ,      **A__   :       Optional[int]	)					->  Any:
        return cls(vision_config=vision_config.to_dict()    ,      text_config=text_config.to_dict()    ,      **A__	)







      def 		UpperCamelCase_	(    self   :       Any	)					->  List[str]:
        _snake_case		=							copy.deepcopy(self.__dict__	)
        _snake_case		=							self.vision_config.to_dict()
        _snake_case		=							self.text_config.to_dict()
        _snake_case		=							self.__class__.model_type
        return output




from collections import namedtuple

__A    	=			namedtuple('''from_to''', '''from_ to''')

__A    	=			{
    '''atm''': from_to(1, 1),
    '''pascal''': from_to(0.000_0098, 10_13_25),
    '''bar''': from_to(0.98_6923, 1.0_1325),
    '''kilopascal''': from_to(0.0098_6923, 101.325),
    '''megapascal''': from_to(9.8_6923, 0.10_1325),
    '''psi''': from_to(0.06_8046, 14.6959),
    '''inHg''': from_to(0.033_4211, 29.9213),
    '''torr''': from_to(0.0013_1579, 7_60),
}



def    snake_case_(_UpperCamelCase				, _UpperCamelCase				, _UpperCamelCase  )							->			float:



  """simple docstring"""






  if from_type not in PRESSURE_CONVERSION:
    raise ValueError(
        F"""Invalid 'from_type' value: {from_type!r}  Supported values are:\n"""
        + ''', '''.join(_UpperCamelCase  )  )
  if to_type not in PRESSURE_CONVERSION:
    raise ValueError(
        F"""Invalid 'to_type' value: {to_type!r}.  Supported values are:\n"""
        + ''', '''.join(_UpperCamelCase  )  )
  return (
      value * PRESSURE_CONVERSION[from_type].from_ * PRESSURE_CONVERSION[to_type].to
  )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

