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


A__ :		int					=logging.get_logger(__name__)







class 			__A					(			_SCREAMING_SNAKE_CASE      ):
 lowerCamelCase												='''vision-text-dual-encoder'''
 lowerCamelCase												=True
 def __init__( self      :     List[Any]					, lowerCamelCase      :     Any=5_12					, lowerCamelCase      :     Optional[int]=2.6_592					, **lowerCamelCase      :     Optional[int]							):



   """simple docstring"""





   super().__init__(**lowerCamelCase							)

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

   __A		:  List[Any]       				=		kwargs.pop("""vision_config"""							)
   __A		:  Dict       				=		kwargs.pop("""text_config"""							)

   __A		:  Any       				=		vision_config.pop("""model_type"""							)
   __A		:  Optional[Any]       				=		text_config.pop("""model_type"""							)

   if vision_model_type == "clip":
     __A		:  List[str]       				=		AutoConfig.for_model(lowerCamelCase					, **lowerCamelCase							).vision_config
   elif vision_model_type == "clip_vision_model":
     __A		:  Dict       				=		CLIPVisionConfig(**lowerCamelCase							)
   else:
     __A		:  Optional[Any]       				=		AutoConfig.for_model(lowerCamelCase					, **lowerCamelCase							)

   __A		:  Tuple       				=		AutoConfig.for_model(lowerCamelCase					, **lowerCamelCase							)

   __A		:  str       				=		projection_dim
   __A		:  Tuple       				=		logit_scale_init_value
 @classmethod
 def 		lowercase_( cls      :     Optional[int]					, lowerCamelCase      :     PretrainedConfig					, lowerCamelCase      :     PretrainedConfig					, **lowerCamelCase      :     Any							):



   """simple docstring"""





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






 def 		lowercase_( self      :     Any							):



   """simple docstring"""





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





'''simple docstring'''
import warnings

from ...utils import logging
from .image_processing_vit import ViTImageProcessor


A__ :		Optional[int]					=logging.get_logger(__name__)







class 			__A					(			_SCREAMING_SNAKE_CASE      ):
 def __init__( self      :     Union[str, Any]					, *lowerCamelCase      :     Dict					, **lowerCamelCase      :     Optional[Any]							):



   """simple docstring"""





   warnings.warn(
       """The class ViTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"""
       """ use ViTImageProcessor instead."""					, lowerCamelCase					, )
   super().__init__(*lowerCamelCase					, **lowerCamelCase							)



