'''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 					a__   (     UpperCAmelCase__				):
     lowerCamelCase						:  Union[str, Any]							="vision-text-dual-encoder"
     lowerCamelCase						:  str							=True






     def __init__(				self	:	Any						,       a	:	str=5_12						,       a	:	int=2.65_92						,       **a	:	Union[str, Any]					):





         """simple docstring"""



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

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

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

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

         __lowerCamelCase						=						AutoConfig.for_model(a						,       **a					)

         __lowerCamelCase						=						projection_dim
         __lowerCamelCase						=						logit_scale_init_value






     @classmethod
     def      SCREAMING_SNAKE_CASE__     (				cls	:	List[Any]						,       a	:	PretrainedConfig						,       a	:	PretrainedConfig						,       **a	:	int					):





         """simple docstring"""



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






     def      SCREAMING_SNAKE_CASE__     (				self	:	List[str]					):





         """simple docstring"""



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

'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__UpperCAmelCase  							={
    "configuration_rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig", "RwkvOnnxConfig"],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase  							=[
      "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST",
      "RwkvForCausalLM",
      "RwkvModel",
      "RwkvPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_rwkv import (
        RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
        RwkvForCausalLM,
        RwkvModel,
        RwkvPreTrainedModel,
    )
else:
  import sys

  __UpperCAmelCase  							=_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
