"""simple docstring"""



import copy
from typing import Dict

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
from ..bit import BitConfig


_UpperCamelCase         =		logging.get_logger(__name__)

_UpperCamelCase         =		{
    "google/vit-hybrid-base-bit-384": "https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json",
    # See all ViT hybrid models at https://huggingface.co/models?filter=vit
}
class 	__UpperCAmelCase						(__A    ):







			'''simple docstring'''
			_UpperCamelCase     :	Optional[Any]				    =							'vit-hybrid'





			def __init__( self      ,			snake_case_=None      ,			snake_case_=768      ,			snake_case_=12      ,			snake_case_=12      ,			snake_case_=3_072      ,			snake_case_="gelu"      ,			snake_case_=0.0      ,			snake_case_=0.0      ,			snake_case_=0.02      ,			snake_case_=1E-12      ,			snake_case_=224      ,			snake_case_=1      ,			snake_case_=3      ,			snake_case_=[1, 1_024, 24, 24]      ,			snake_case_=True      ,			**snake_case_      ,			):







										'''simple docstring'''


										super().__init__(**snake_case_       )

										if backbone_config is None:
																	logger.info("""`backbone_config` is `None`. Initializing the config with a `BiT` backbone."""       )
																	A__					:    List[Any]														= {
																	    """global_padding""": """same""",
																	    """layer_type""": """bottleneck""",
																	    """depths""": [3, 4, 9],
																	    """out_features""": ["""stage3"""],
																	    """embedding_dynamic_padding""": True,
																	}

										if isinstance(snake_case_      ,			snake_case_       ):
																	if "model_type" in backbone_config:
																								A__					:    Dict														= CONFIG_MAPPING[backbone_config["""model_type"""]]
																	else:
																								logger.info(
																								    """`model_type` is not found in `backbone_config`. Use `Bit` as the backbone configuration class."""       )
																								A__					:    Optional[int]														= BitConfig
																	A__					:    str														= backbone_config_class(**snake_case_       )

										A__					:    Optional[int]														= backbone_featmap_shape
										A__					:    Tuple														= backbone_config
										A__					:    str														= hidden_size
										A__					:    int														= num_hidden_layers
										A__					:    List[str]														= num_attention_heads
										A__					:    Any														= intermediate_size
										A__					:    str														= hidden_act
										A__					:    Optional[Any]														= hidden_dropout_prob
										A__					:    Tuple														= attention_probs_dropout_prob
										A__					:    Dict														= initializer_range
										A__					:    Optional[Any]														= layer_norm_eps
										A__					:    Tuple														= image_size
										A__					:    str														= patch_size
										A__					:    Any														= num_channels
										A__					:    Tuple														= qkv_bias





			def 		lowerCamelCase				( self       ):







										'''simple docstring'''


										A__					:    List[str]														= copy.deepcopy(self.__dict__       )
										A__					:    Tuple														= self.backbone_config.to_dict()
										A__					:    Tuple														= self.__class__.model_type
										return output






"""simple docstring"""



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


_UpperCamelCase         =		logging.get_logger(__name__)

_UpperCamelCase         =		{
    "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						(__A    ):







			'''simple docstring'''
			_UpperCamelCase     :	Dict				    =							'opt'
			_UpperCamelCase     :	Optional[Any]				    =							['past_key_values']





			def __init__( self      ,			snake_case_=50_272      ,			snake_case_=768      ,			snake_case_=12      ,			snake_case_=3_072      ,			snake_case_=2_048      ,			snake_case_=True      ,			snake_case_=False      ,			snake_case_=None      ,			snake_case_=0.1      ,			snake_case_=0.0      ,			snake_case_=12      ,			snake_case_="relu"      ,			snake_case_=0.0      ,			snake_case_=0.02      ,			snake_case_=True      ,			snake_case_=1      ,			snake_case_=2      ,			snake_case_=2      ,			snake_case_=True      ,			snake_case_=True      ,			**snake_case_      ,			):







										'''simple docstring'''


										super().__init__(
										    pad_token_id=snake_case_      ,			bos_token_id=snake_case_      ,			eos_token_id=snake_case_      ,			**snake_case_      ,			)
										A__					:    int														= vocab_size
										A__					:    List[str]														= max_position_embeddings
										A__					:    str														= num_attention_heads
										A__					:    Dict														= word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
										A__					:    Optional[int]														= ffn_dim
										A__					:    Optional[int]														= hidden_size
										A__					:    int														= num_hidden_layers
										A__					:    str														= dropout
										A__					:    Tuple														= attention_dropout
										A__					:    Optional[Any]														= activation_function
										A__					:    Any														= init_std
										A__					:    Optional[int]														= layerdrop
										A__					:    Optional[int]														= use_cache
										A__					:    int														= do_layer_norm_before
										# We keep these variables at `True` for backward compatibility.
										A__					:    str														= enable_bias
										A__					:    List[str]														= 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
										A__					:    str														= _remove_final_layer_norm





