import copy

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


_lowerCAmelCase        =       logging.get_logger(__name__)






class     __UpperCAmelCase(    A__				):






 """simple docstring"""




 __magic_name__          =   """hybrid-clip"""
 __magic_name__          =   True
 def __init__(    self ,       __magic_name__=512 ,       **__magic_name__      ):

        """simple docstring"""

        super().__init__(**__magic_name__      )

        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_							:       Dict	      =				kwargs.pop('''text_config'''      )
        A_							:       Tuple	      =				kwargs.pop('''vision_config'''      )

        A_							:       Optional[Any]	      =				text_config.pop('''model_type'''      )
        A_							:       Dict	      =				vision_config.pop('''model_type'''      )

        from transformers import AutoConfig

        A_							:       Optional[Any]	      =				AutoConfig.for_model(__magic_name__ ,       **__magic_name__      )

        if vision_model_type == "clip":
               A_							:       List[str]	      =				AutoConfig.for_model(__magic_name__ ,       **__magic_name__      ).vision_config
        elif vision_model_type == "clip_vision_model":
               from transformers import CLIPVisionConfig

               A_							:       List[str]	      =				CLIPVisionConfig(**__magic_name__      )
        else:
               A_							:       List[str]	      =				AutoConfig.for_model(__magic_name__ ,       **__magic_name__      )

        A_							:       str	      =				projection_dim
        A_							:       List[str]	      =				1.0
 @classmethod
 def  UpperCAmelCase   (    cls ,       __magic_name__ ,       __magic_name__ ,       **__magic_name__      ):

        """simple docstring"""

        return cls(text_config=text_config.to_dict() ,       vision_config=vision_config.to_dict() ,       **__magic_name__      )
 def  UpperCAmelCase   (    self      ):

        """simple docstring"""

        A_							:       Dict	      =				copy.deepcopy(self.__dict__      )
        A_							:       str	      =				self.text_config.to_dict()
        A_							:       Any	      =				self.vision_config.to_dict()
        A_							:       Dict	      =				self.__class__.model_type
        return output



from transformers import ProcessorMixin






class     __UpperCAmelCase(    A__				):






 """simple docstring"""




 __magic_name__          =   """AutoFeatureExtractor"""
 __magic_name__          =   """AutoTokenizer"""


