





"""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


SCREAMING_SNAKE_CASE__ =       logging.get_logger(__name__)

class 		lowercase ( _UpperCAmelCase ):
      _SCREAMING_SNAKE_CASE         =				'vision-text-dual-encoder'
      _SCREAMING_SNAKE_CASE         =				True





      def __init__(	self				,						lowercase=512				,						lowercase=2.6_592				,						**lowercase			)		->					Dict:
            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  						=	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(lowercase				,						**lowercase			).vision_config
            elif vision_model_type == "clip_vision_model":
                  lowerCAmelCase  						=	CLIPVisionConfig(**lowercase			)
            else:
                  lowerCAmelCase  						=	AutoConfig.for_model(lowercase				,						**lowercase			)

            lowerCAmelCase  						=	AutoConfig.for_model(lowercase				,						**lowercase			)

            lowerCAmelCase  						=	projection_dim
            lowerCAmelCase  						=	logit_scale_init_value





      @classmethod
      def    _snake_case      (	cls				,						lowercase				,						lowercase				,						**lowercase			)		->					int:
            return cls(vision_config=vision_config.to_dict()				,						text_config=text_config.to_dict()				,						**lowercase			)





      def    _snake_case      (	self			)		->					str:
            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 scipy.constants import g


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						float							,						SCREAMING_SNAKE_CASE					:						float      ):







      '''simple docstring'''




      if mass < 0:
            # handling of negative values of mass
            raise ValueError("""The mass of a body cannot be negative"""      )
      if height < 0:
            # handling of negative values of height
            raise ValueError("""The height above the ground cannot be negative"""      )
      return mass * g * height


if __name__ == "__main__":
       from doctest import testmod

       testmod(name="potential_energy")






