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


lowerCAmelCase :    Dict								=						logging.get_logger(__name__)

class    A_     (					A__       ):



							"""simple docstring"""






							SCREAMING_SNAKE_CASE_     				=       """vision-text-dual-encoder"""
							SCREAMING_SNAKE_CASE_     				=       True





							def __init__(  self  :Any					,							lowerCamelCase_  :List[str]=512					,							lowerCamelCase_  :Dict=2.65_92					,							**lowerCamelCase_  :Tuple	):





										"""simple docstring"""

										super().__init__(**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`.'	)

										lowerCamelCase__     :					List[str]		=kwargs.pop('vision_config'	)
										lowerCamelCase__     :					int		=kwargs.pop('text_config'	)

										lowerCamelCase__     :					int		=vision_config.pop('model_type'	)
										lowerCamelCase__     :					Optional[Any]		=text_config.pop('model_type'	)

										if vision_model_type == "clip":
													lowerCamelCase__     :					Any		=AutoConfig.for_model(snake_case_					,							**snake_case_	).vision_config
										elif vision_model_type == "clip_vision_model":
													lowerCamelCase__     :					List[Any]		=CLIPVisionConfig(**snake_case_	)
										else:
													lowerCamelCase__     :					Any		=AutoConfig.for_model(snake_case_					,							**snake_case_	)

										lowerCamelCase__     :					Optional[int]		=AutoConfig.for_model(snake_case_					,							**snake_case_	)

										lowerCamelCase__     :					int		=projection_dim
										lowerCamelCase__     :					Union[str, Any]		=logit_scale_init_value





							@classmethod
							def 				UpperCAmelCase__							(  cls  :Any					,							lowerCamelCase_  :List[Any]					,							lowerCamelCase_  :Tuple					,							**lowerCamelCase_  :List[Any]	):





										"""simple docstring"""

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





							def 				UpperCAmelCase__							(  self  :List[Any]	):





										"""simple docstring"""

										lowerCamelCase__     :					int		=copy.deepcopy(self.__dict__	)
										lowerCamelCase__     :					List[Any]		=self.vision_config.to_dict()
										lowerCamelCase__     :					Union[str, Any]		=self.text_config.to_dict()
										lowerCamelCase__     :					str		=self.__class__.model_type
										return output

"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase								=						{
    """configuration_decision_transformer""": [
        """DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """DecisionTransformerConfig""",
    ],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase								=						[
							    """DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """DecisionTransformerGPT2Model""",
							    """DecisionTransformerGPT2PreTrainedModel""",
							    """DecisionTransformerModel""",
							    """DecisionTransformerPreTrainedModel""",
							]


if TYPE_CHECKING:
							from .configuration_decision_transformer import (
							    DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    DecisionTransformerConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_decision_transformer import (
														    DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DecisionTransformerGPTaModel,
														    DecisionTransformerGPTaPreTrainedModel,
														    DecisionTransformerModel,
														    DecisionTransformerPreTrainedModel,
														)


else:
							import sys

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