

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


_a:      str								=     logging.get_logger(__name__)

_a:      Union[str, Any]								=     {
    """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      (   SCREAMING_SNAKE_CASE__  ):
						SCREAMING_SNAKE_CASE__      			=       'opt'
						SCREAMING_SNAKE_CASE__      			=       ['past_key_values']




						def __init__(						self		:  Any						,		lowerCAmelCase		:  str=50_272						,		lowerCAmelCase		:  Tuple=768						,		lowerCAmelCase		:  Union[str, Any]=12						,		lowerCAmelCase		:  Optional[int]=3_072						,		lowerCAmelCase		:  Dict=2_048						,		lowerCAmelCase		:  int=True						,		lowerCAmelCase		:  int=False						,		lowerCAmelCase		:  List[str]=None						,		lowerCAmelCase		:  Optional[Any]=0.1						,		lowerCAmelCase		:  Any=0.0						,		lowerCAmelCase		:  Optional[int]=12						,		lowerCAmelCase		:  Optional[Any]="relu"						,		lowerCAmelCase		:  int=0.0						,		lowerCAmelCase		:  Any=0.02						,		lowerCAmelCase		:  List[Any]=True						,		lowerCAmelCase		:  Union[str, Any]=1						,		lowerCAmelCase		:  List[str]=2						,		lowerCAmelCase		:  List[Any]=2						,		lowerCAmelCase		:  List[str]=True						,		lowerCAmelCase		:  Optional[int]=True						,		**lowerCAmelCase		:  Tuple						,		):


							'''simple docstring'''







							super().__init__(
							    pad_token_id=_UpperCAmelCase						,		bos_token_id=_UpperCAmelCase						,		eos_token_id=_UpperCAmelCase						,		**_UpperCAmelCase						,		)
							UpperCAmelCase_    			=     vocab_size
							UpperCAmelCase_    			=     max_position_embeddings
							UpperCAmelCase_    			=     num_attention_heads
							UpperCAmelCase_    			=     word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
							UpperCAmelCase_    			=     ffn_dim
							UpperCAmelCase_    			=     hidden_size
							UpperCAmelCase_    			=     num_hidden_layers
							UpperCAmelCase_    			=     dropout
							UpperCAmelCase_    			=     attention_dropout
							UpperCAmelCase_    			=     activation_function
							UpperCAmelCase_    			=     init_std
							UpperCAmelCase_    			=     layerdrop
							UpperCAmelCase_    			=     use_cache
							UpperCAmelCase_    			=     do_layer_norm_before
							# We keep these variables at `True` for backward compatibility.
							UpperCAmelCase_    			=     enable_bias
							UpperCAmelCase_    			=     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_    			=     _remove_final_layer_norm


from typing import TYPE_CHECKING

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


_a:      Dict								=     {
    """configuration_nystromformer""": ["""NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NystromformerConfig"""],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_a:      Any								=     [
				    """NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
				    """NystromformerForMaskedLM""",
				    """NystromformerForMultipleChoice""",
				    """NystromformerForQuestionAnswering""",
				    """NystromformerForSequenceClassification""",
				    """NystromformerForTokenClassification""",
				    """NystromformerLayer""",
				    """NystromformerModel""",
				    """NystromformerPreTrainedModel""",
				]


if TYPE_CHECKING:
				from .configuration_nystromformer import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_nystromformer import (
								    NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
								    NystromformerForMaskedLM,
								    NystromformerForMultipleChoice,
								    NystromformerForQuestionAnswering,
								    NystromformerForSequenceClassification,
								    NystromformerForTokenClassification,
								    NystromformerLayer,
								    NystromformerModel,
								    NystromformerPreTrainedModel,
								)


else:
				import sys

				_a:      Optional[Any]								=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)