





"""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__    :   str    						= logging.get_logger(__name__)



class    lowercase_ (   __lowerCAmelCase							):
       snake_case__ :							Dict 							=   """vision-text-dual-encoder"""
       snake_case__ :							int 							=   True

       def __init__(	self      ,    __SCREAMING_SNAKE_CASE=512      ,    __SCREAMING_SNAKE_CASE=2.6592      ,    **__SCREAMING_SNAKE_CASE   ):






        '''simple docstring'''

        super().__init__(**__SCREAMING_SNAKE_CASE   )

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

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

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

        if vision_model_type == "clip":
         snake_case__										= AutoConfig.for_model(__SCREAMING_SNAKE_CASE      ,    **__SCREAMING_SNAKE_CASE   ).vision_config
        elif vision_model_type == "clip_vision_model":
         snake_case__										= CLIPVisionConfig(**__SCREAMING_SNAKE_CASE   )
        else:
         snake_case__										= AutoConfig.for_model(__SCREAMING_SNAKE_CASE      ,    **__SCREAMING_SNAKE_CASE   )

        snake_case__										= AutoConfig.for_model(__SCREAMING_SNAKE_CASE      ,    **__SCREAMING_SNAKE_CASE   )

        snake_case__										= projection_dim
        snake_case__										= logit_scale_init_value

       @classmethod
       def 						_SCREAMING_SNAKE_CASE(	cls      ,    __SCREAMING_SNAKE_CASE      ,    __SCREAMING_SNAKE_CASE      ,    **__SCREAMING_SNAKE_CASE   ):






        '''simple docstring'''

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

       def 						_SCREAMING_SNAKE_CASE(	self   ):






        '''simple docstring'''

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








"""simple docstring"""


import warnings

from ...utils import logging
from .image_processing_vilt import ViltImageProcessor


a__    :   str    						= logging.get_logger(__name__)



class    lowercase_ (   __lowerCAmelCase							):

       def __init__(	self      ,    *__SCREAMING_SNAKE_CASE      ,    **__SCREAMING_SNAKE_CASE   ):






        '''simple docstring'''

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

