




import copy

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


UpperCamelCase__		=						logging.get_logger(__name__)


class     __SCREAMING_SNAKE_CASE							(		lowerCamelCase  ):
					_lowerCamelCase		  =			"""hybrid-clip"""
					_lowerCamelCase		  =			True

					def __init__(    self			,	__lowercase=512			,	**__lowercase ):







						'''simple docstring'''




						super().__init__(**__lowercase )

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

						lowerCamelCase_							:		Union[str, Any]							       =							kwargs.pop('text_config' )
						lowerCamelCase_							:		str							       =							kwargs.pop('vision_config' )

						lowerCamelCase_							:		Any							       =							text_config.pop('model_type' )
						lowerCamelCase_							:		Optional[int]							       =							vision_config.pop('model_type' )

						from transformers import AutoConfig

						lowerCamelCase_							:		Tuple							       =							AutoConfig.for_model(__lowercase			,	**__lowercase )

						if vision_model_type == "clip":
							lowerCamelCase_							:		List[Any]							       =							AutoConfig.for_model(__lowercase			,	**__lowercase ).vision_config
						elif vision_model_type == "clip_vision_model":
							from transformers import CLIPVisionConfig

							lowerCamelCase_							:		str							       =							CLIPVisionConfig(**__lowercase )
						else:
							lowerCamelCase_							:		Any							       =							AutoConfig.for_model(__lowercase			,	**__lowercase )

						lowerCamelCase_							:		Tuple							       =							projection_dim
						lowerCamelCase_							:		List[str]							       =							1.0

					@classmethod
					def      lowercase_							(    cls			,	__lowercase			,	__lowercase			,	**__lowercase ):







						'''simple docstring'''




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





					def      lowercase_							(    self ):







						'''simple docstring'''




						lowerCamelCase_							:		Dict							       =							copy.deepcopy(self.__dict__ )
						lowerCamelCase_							:		Dict							       =							self.text_config.to_dict()
						lowerCamelCase_							:		Union[str, Any]							       =							self.vision_config.to_dict()
						lowerCamelCase_							:		Dict							       =							self.__class__.model_type
						return output






from typing import Callable






def  snake_case (							A      )							->							List[str]:




	'''simple docstring'''


	def wrapper(A      ):
		lowerCamelCase_							:		Dict							       =							function_with_docstring.__doc__
		return target_function

	return wrapper
