

import copy

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


UpperCamelCase__					: Dict								=      logging.get_logger(__name__)



class  __snake_case					(      lowerCAmelCase__    ):
  __lowerCAmelCase       :		Tuple  	=					'hybrid-clip'
  __lowerCAmelCase       :		str  	=					True

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

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

      SCREAMING_SNAKE_CASE_													=  kwargs.pop('text_config')
      SCREAMING_SNAKE_CASE_													=  kwargs.pop('vision_config')

      SCREAMING_SNAKE_CASE_													=  text_config.pop('model_type')
      SCREAMING_SNAKE_CASE_													=  vision_config.pop('model_type')

      from transformers import AutoConfig

      SCREAMING_SNAKE_CASE_													=  AutoConfig.for_model(_A  ,						**_A)

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

          SCREAMING_SNAKE_CASE_													=  CLIPVisionConfig(**_A)
      else:
          SCREAMING_SNAKE_CASE_													=  AutoConfig.for_model(_A  ,						**_A)

      SCREAMING_SNAKE_CASE_													=  projection_dim
      SCREAMING_SNAKE_CASE_													=  1.0

  @classmethod
  def   lowerCAmelCase__       (   cls  ,						_A  ,						_A  ,						**_A):
      return cls(text_config=text_config.to_dict()  ,						vision_config=vision_config.to_dict()  ,						**_A)


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





def    _UpperCAmelCase    (					_SCREAMING_SNAKE_CASE   :						int	,				_SCREAMING_SNAKE_CASE   :						int	,				_SCREAMING_SNAKE_CASE   :						int    ):





    """simple docstring"""


    if power < 0:
        return -1
    base %= mod
    SCREAMING_SNAKE_CASE_													=  1

    while power > 0:
        if power & 1:
            SCREAMING_SNAKE_CASE_													=  (result * base) % mod
        SCREAMING_SNAKE_CASE_													=  power >> 1
        SCREAMING_SNAKE_CASE_													=  (base * base) % mod

    return result


def    _UpperCAmelCase    (					):





    """simple docstring"""


    print(modular_exponential(3	,				200	,				13    )    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       main()


