





import copy

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


_lowerCamelCase							=     logging.get_logger(__name__)




class 					UpperCamelCase_    (       UpperCamelCase__      ):
	lowerCamelCase_          =   "hybrid-clip"
	lowerCamelCase_          =   True


	def __init__(							self      :int							,			__A      :List[Any]=512							,			**__A      :Dict						)				->				str:



			"""simple docstring"""



			super().__init__(**__A						)

			if "text_config" not in kwargs:
					raise ValueError("""`text_config` can not be `None`."""						)

			if "vision_config" not in kwargs:
					raise ValueError("""`vision_config` can not be `None`."""						)

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

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

			from transformers import AutoConfig

			SCREAMING_SNAKE_CASE__								= AutoConfig.for_model(__A							,			**__A						)

			if vision_model_type == "clip":
					SCREAMING_SNAKE_CASE__								= AutoConfig.for_model(__A							,			**__A						).vision_config
			elif vision_model_type == "clip_vision_model":
					from transformers import CLIPVisionConfig

					SCREAMING_SNAKE_CASE__								= CLIPVisionConfig(**__A						)
			else:
					SCREAMING_SNAKE_CASE__								= AutoConfig.for_model(__A							,			**__A						)

			SCREAMING_SNAKE_CASE__								= projection_dim
			SCREAMING_SNAKE_CASE__								= 1.0


	@classmethod
	def        _snake_case					(							cls      :str							,			__A      :PretrainedConfig							,			__A      :PretrainedConfig							,			**__A      :Optional[Any]						)				->				Tuple:



			"""simple docstring"""



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


	def        _snake_case					(							self      :Tuple						)				->				Tuple:



			"""simple docstring"""



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






from __future__ import annotations






def 			SCREAMING_SNAKE_CASE__							(    UpperCamelCase__:							list[int | float]      ):
		if len(UpperCamelCase__      ) == 0:
				raise ValueError("""find_min() arg is an empty sequence"""      )
		SCREAMING_SNAKE_CASE__								= nums[0]
		for num in nums:
				SCREAMING_SNAKE_CASE__								= min(UpperCamelCase__   ,				UpperCamelCase__      )
		return min_num


if __name__ == "__main__":
	import doctest

	doctest.testmod(verbose=True)