"""simple docstring"""


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


a							=logging.get_logger(__name__)

a							={
    'facebook/opt-125m': 'https://huggingface.co/facebook/opt-125m/blob/main/config.json',
    'facebook/opt-350m': 'https://huggingface.co/facebook/opt-350m/blob/main/config.json',
    'facebook/opt-1.3b': 'https://huggingface.co/facebook/opt-1.3b/blob/main/config.json',
    'facebook/opt-2.7b': 'https://huggingface.co/facebook/opt-2.7b/blob/main/config.json',
    'facebook/opt-6.7b': 'https://huggingface.co/facebook/opt-6.7b/blob/main/config.json',
    'facebook/opt-13b': 'https://huggingface.co/facebook/opt-13b/blob/main/config.json',
}






class    __UpperCAmelCase						(	__lowerCAmelCase	):
				A__      :   Optional[Any]  							=       '''opt'''
				A__      :   Tuple  							=       ['''past_key_values''']

				def __init__(      self	, _lowerCamelCase=50272	, _lowerCamelCase=768	, _lowerCamelCase=12	, _lowerCamelCase=3072	, _lowerCamelCase=2048	, _lowerCamelCase=True	, _lowerCamelCase=False	, _lowerCamelCase=None	, _lowerCamelCase=0.1	, _lowerCamelCase=0.0	, _lowerCamelCase=12	, _lowerCamelCase="relu"	, _lowerCamelCase=0.0	, _lowerCamelCase=0.0_2	, _lowerCamelCase=True	, _lowerCamelCase=1	, _lowerCamelCase=2	, _lowerCamelCase=2	, _lowerCamelCase=True	, _lowerCamelCase=True	, **_lowerCamelCase	, ):
										super().__init__(
										    pad_token_id=_lowerCamelCase	, bos_token_id=_lowerCamelCase	, eos_token_id=_lowerCamelCase	, **_lowerCamelCase	, )
										lowerCamelCase__					=vocab_size
										lowerCamelCase__					=max_position_embeddings
										lowerCamelCase__					=num_attention_heads
										lowerCamelCase__					=word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
										lowerCamelCase__					=ffn_dim
										lowerCamelCase__					=hidden_size
										lowerCamelCase__					=num_hidden_layers
										lowerCamelCase__					=dropout
										lowerCamelCase__					=attention_dropout
										lowerCamelCase__					=activation_function
										lowerCamelCase__					=init_std
										lowerCamelCase__					=layerdrop
										lowerCamelCase__					=use_cache
										lowerCamelCase__					=do_layer_norm_before
										# We keep these variables at `True` for backward compatibility.
										lowerCamelCase__					=enable_bias
										lowerCamelCase__					=layer_norm_elementwise_affine

										# Note that the only purpose of `_remove_final_layer_norm` is to keep backward compatibility
										# with checkpoints that have been fine-tuned before transformers v4.20.1
										# see https://github.com/facebookresearch/metaseq/pull/164
										lowerCamelCase__					=_remove_final_layer_norm



"""simple docstring"""


import copy

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


a							=logging.get_logger(__name__)






class    __UpperCAmelCase						(	__lowerCAmelCase	):
				A__      :   Any  							=       '''hybrid-clip'''
				A__      :   Optional[Any]  							=       True

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

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

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

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

										from transformers import AutoConfig

										lowerCamelCase__					=AutoConfig.for_model(_lowerCamelCase	, **_lowerCamelCase      )

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

																lowerCamelCase__					=CLIPVisionConfig(**_lowerCamelCase      )
										else:
																lowerCamelCase__					=AutoConfig.for_model(_lowerCamelCase	, **_lowerCamelCase      )

										lowerCamelCase__					=projection_dim
										lowerCamelCase__					=1.0

				@classmethod
				def 		_a	(      cls	, _lowerCamelCase	, _lowerCamelCase	, **_lowerCamelCase      ):
										return cls(text_config=text_config.to_dict()	, vision_config=vision_config.to_dict()	, **_lowerCamelCase      )






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


