


'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowerCAmelCase	:		Optional[Any]		  =						{
    'configuration_mpnet': ['MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MPNetConfig'],
    'tokenization_mpnet': ['MPNetTokenizer'],
}

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCAmelCase	:		List[Any]		  =						['MPNetTokenizerFast']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCAmelCase	:		List[Any]		  =						[
				    'MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'MPNetForMaskedLM',
				    'MPNetForMultipleChoice',
				    'MPNetForQuestionAnswering',
				    'MPNetForSequenceClassification',
				    'MPNetForTokenClassification',
				    'MPNetLayer',
				    'MPNetModel',
				    'MPNetPreTrainedModel',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCAmelCase	:		Dict		  =						[
				    'TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'TFMPNetEmbeddings',
				    'TFMPNetForMaskedLM',
				    'TFMPNetForMultipleChoice',
				    'TFMPNetForQuestionAnswering',
				    'TFMPNetForSequenceClassification',
				    'TFMPNetForTokenClassification',
				    'TFMPNetMainLayer',
				    'TFMPNetModel',
				    'TFMPNetPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
				from .tokenization_mpnet import MPNetTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_mpnet_fast import MPNetTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_mpnet import (
								    MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
								    MPNetForMaskedLM,
								    MPNetForMultipleChoice,
								    MPNetForQuestionAnswering,
								    MPNetForSequenceClassification,
								    MPNetForTokenClassification,
								    MPNetLayer,
								    MPNetModel,
								    MPNetPreTrainedModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_mpnet import (
								    TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFMPNetEmbeddings,
								    TFMPNetForMaskedLM,
								    TFMPNetForMultipleChoice,
								    TFMPNetForQuestionAnswering,
								    TFMPNetForSequenceClassification,
								    TFMPNetForTokenClassification,
								    TFMPNetMainLayer,
								    TFMPNetModel,
								    TFMPNetPreTrainedModel,
								)

else:
				import sys

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




'''simple docstring'''




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


_lowerCAmelCase	:		List[str]		  =						logging.get_logger(__name__)

_lowerCAmelCase	:		int		  =						{
    '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 			lowerCAmelCase					(					a				):
	_lowerCamelCase :       Dict         =			"""opt"""
	_lowerCamelCase :       Optional[Any]         =			["""past_key_values"""]



	def __init__(       self			,       snake_case__=5_0272			,       snake_case__=768			,       snake_case__=12			,       snake_case__=3072			,       snake_case__=2048			,       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.0_2			,       snake_case__=True			,       snake_case__=1			,       snake_case__=2			,       snake_case__=2			,       snake_case__=True			,       snake_case__=True			,       **snake_case__			,       ):
		super().__init__(
		    pad_token_id=snake_case__			,       bos_token_id=snake_case__			,       eos_token_id=snake_case__			,       **snake_case__			,       )
		lowerCAmelCase       :     Union[str, Any]   				=			vocab_size
		lowerCAmelCase       :     List[Any]   				=			max_position_embeddings
		lowerCAmelCase       :     List[str]   				=			num_attention_heads
		lowerCAmelCase       :     Dict   				=			word_embed_proj_dim if word_embed_proj_dim is not None else hidden_size
		lowerCAmelCase       :     Optional[Any]   				=			ffn_dim
		lowerCAmelCase       :     Optional[int]   				=			hidden_size
		lowerCAmelCase       :     List[str]   				=			num_hidden_layers
		lowerCAmelCase       :     Union[str, Any]   				=			dropout
		lowerCAmelCase       :     List[str]   				=			attention_dropout
		lowerCAmelCase       :     Union[str, Any]   				=			activation_function
		lowerCAmelCase       :     Optional[Any]   				=			init_std
		lowerCAmelCase       :     List[str]   				=			layerdrop
		lowerCAmelCase       :     Dict   				=			use_cache
		lowerCAmelCase       :     List[Any]   				=			do_layer_norm_before
		# We keep these variables at `True` for backward compatibility.
		lowerCAmelCase       :     List[str]   				=			enable_bias
		lowerCAmelCase       :     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
		lowerCAmelCase       :     Tuple   				=			_remove_final_layer_norm
