



import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..clip.configuration_clip import CLIPVisionConfig


__lowerCamelCase								=   logging.get_logger(__name__)



class 						_snake_case (     __lowerCAmelCase			):





	"""simple docstring"""



	lowerCamelCase_       =     '''vision-text-dual-encoder'''
	lowerCamelCase_       =     True
	def __init__(  self		,      a=5_1_2		,      a=2.6_592		,      **a   )		->							int:




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

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

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

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

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

			_A          =      projection_dim
			_A          =      logit_scale_init_value
	@classmethod
	def lowercase_						(  cls		,      a		,      a		,      **a   )		->							Optional[Any]:




			"""simple docstring"""







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



	def lowercase_						(  self   )		->							Optional[Any]:




			"""simple docstring"""







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




import warnings

from .generation import FlaxGenerationMixin



class 						_snake_case (     lowerCamelCase			):





 """simple docstring"""



 warnings.warn(
     '''Importing `FlaxGenerationMixin` from `src/transformers/generation_flax_utils.py` is deprecated and will '''
     '''be removed in Transformers v5. Import as `from transformers import FlaxGenerationMixin` instead.'''   ,lowerCamelCase   ,)