






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


_UpperCamelCase     			=  logging.get_logger(__name__)







class 					lowerCamelCase__					(       snake_case ):
    SCREAMING_SNAKE_CASE		=			'''vision-text-dual-encoder'''
    SCREAMING_SNAKE_CASE		=			True






    def __init__( self	,A=512	,A=2.6592	,**A					):
          super().__init__(**A					)

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

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

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

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

          UpperCAmelCase							=       AutoConfig.for_model(A	,**A					)

          UpperCAmelCase							=       projection_dim
          UpperCAmelCase							=       logit_scale_init_value






    @classmethod
    def 				_UpperCamelCase							( cls	,A	,A	,**A					):
          return cls(vision_config=vision_config.to_dict()	,text_config=text_config.to_dict()	,**A					)






    def 				_UpperCamelCase							( self					):
          UpperCAmelCase							=       copy.deepcopy(self.__dict__					)
          UpperCAmelCase							=       self.vision_config.to_dict()
          UpperCAmelCase							=       self.text_config.to_dict()
          UpperCAmelCase							=       self.__class__.model_type
          return output











"""simple docstring"""







import sys

def _a (		_snake_case      ,       _snake_case							):







      """simple docstring"""






      if not numbers:
            return 0
      if target == 0 and target in numbers:
            return 0
      if not isinstance(_snake_case      ,       (list, tuple)							) or not all(
          isinstance(_snake_case      ,       _snake_case							) for number in numbers							):
            raise ValueError("""numbers must be an iterable of integers"""							)

      UpperCAmelCase							=       UpperCAmelCase							=       UpperCAmelCase							=       0
      UpperCAmelCase							=       sys.maxsize

      while right < len(_snake_case							):
            curr_sum += numbers[right]
            while curr_sum >= target and left <= right:
                  UpperCAmelCase							=       min(_snake_case      ,       right - left + 1							)
                  curr_sum -= numbers[left]
                  left += 1
            right += 1

      return 0 if min_len == sys.maxsize else min_len



