





"""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  _a						(      _lowerCAmelCase				):
				UpperCamelCase								=    '''opt'''
				UpperCamelCase								=    ['''past_key_values''']






				def __init__( self		:    Optional[Any], lowerCAmelCase__		:    Optional[Any]=5_0_2_7_2, lowerCAmelCase__		:    List[str]=7_6_8, lowerCAmelCase__		:    Optional[int]=1_2, lowerCAmelCase__		:    Tuple=3_0_7_2, lowerCAmelCase__		:    Any=2_0_4_8, lowerCAmelCase__		:    Dict=True, lowerCAmelCase__		:    List[str]=False, lowerCAmelCase__		:    List[str]=None, lowerCAmelCase__		:    Optional[int]=0.1, lowerCAmelCase__		:    int=0.0, lowerCAmelCase__		:    List[Any]=1_2, lowerCAmelCase__		:    Any="relu", lowerCAmelCase__		:    Tuple=0.0, lowerCAmelCase__		:    Optional[int]=0.02, lowerCAmelCase__		:    str=True, lowerCAmelCase__		:    Union[str, Any]=1, lowerCAmelCase__		:    Optional[int]=2, lowerCAmelCase__		:    Optional[int]=2, lowerCAmelCase__		:    Any=True, lowerCAmelCase__		:    Tuple=True, **lowerCAmelCase__		:    Optional[Any], )	->      Tuple:




										'''simple docstring'''



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









'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowerCamelCase							:						Optional[Any]								=  {'configuration_bit': ['BIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BitConfig', 'BitOnnxConfig']}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCamelCase							:						Dict								=  [
						    'BIT_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'BitForImageClassification',
						    'BitModel',
						    'BitPreTrainedModel',
						    'BitBackbone',
						]


try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCamelCase							:						Union[str, Any]								=  ['BitImageProcessor']


if TYPE_CHECKING:
						from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_bit import (
												    BIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    BitBackbone,
												    BitForImageClassification,
												    BitModel,
												    BitPreTrainedModel,
												)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .image_processing_bit import BitImageProcessor

else:
						import sys

						_lowerCamelCase							:						Optional[Any]								=  _LazyModule(__name__, globals()['__file__'], _import_structure)





