
"""simple docstring"""
import copy

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


lowercase		:    Tuple			=       logging.get_logger(__name__)




class  _snake_case	(    _lowercase							):
							SCREAMING_SNAKE_CASE		  =    '''hybrid-clip'''
							SCREAMING_SNAKE_CASE		  =    True






							def __init__(       self    :      List[Any]    ,			snake_case__    :      Any=5_1_2    ,			**snake_case__    :      int     ):






												"""simple docstring"""



												super().__init__(**snake_case__     )

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

												__a:    int		     =       kwargs.pop("""text_config"""     )
												__a:    Union[str, Any]		     =       kwargs.pop("""vision_config"""     )

												__a:    int		     =       text_config.pop("""model_type"""     )
												__a:    Optional[int]		     =       vision_config.pop("""model_type"""     )

												from transformers import AutoConfig

												__a:    Tuple		     =       AutoConfig.for_model(snake_case__    ,			**snake_case__     )

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

																	__a:    Union[str, Any]		     =       CLIPVisionConfig(**snake_case__     )
												else:
																	__a:    Optional[int]		     =       AutoConfig.for_model(snake_case__    ,			**snake_case__     )

												__a:    List[str]		     =       projection_dim
												__a:    str		     =       1.0






							@classmethod
							def 				__lowercase	(       cls    :      Union[str, Any]    ,			snake_case__    :      PretrainedConfig    ,			snake_case__    :      PretrainedConfig    ,			**snake_case__    :      List[Any]     ):






												"""simple docstring"""



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






							def 				__lowercase	(       self    :      Optional[int]     ):






												"""simple docstring"""



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


"""simple docstring"""
from transformers import ProcessorMixin




class  _snake_case	(    _lowercase							):
							SCREAMING_SNAKE_CASE		  =    '''AutoFeatureExtractor'''
							SCREAMING_SNAKE_CASE		  =    '''AutoTokenizer'''
