





'''simple docstring'''






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


A__       :     List[Any]          =logging.get_logger(__name__)

A__       :     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  (    A_     ):
						_lowercase:    Dict		  =     '''opt'''
						_lowercase:    Union[str, Any]		  =     ['''past_key_values''']




						def __init__(    self    :				List[str]    ,    __snake_case    :				List[str]=5_02_72    ,    __snake_case    :				List[Any]=7_68    ,    __snake_case    :				List[str]=12    ,    __snake_case    :				Optional[Any]=30_72    ,    __snake_case    :				Any=20_48    ,    __snake_case    :				Tuple=True    ,    __snake_case    :				Optional[int]=False    ,    __snake_case    :				Any=None    ,    __snake_case    :				List[Any]=0.1    ,    __snake_case    :				Any=0.0    ,    __snake_case    :				Optional[int]=12    ,    __snake_case    :				Union[str, Any]="relu"    ,    __snake_case    :				Tuple=0.0    ,    __snake_case    :				Any=0.02    ,    __snake_case    :				str=True    ,    __snake_case    :				List[str]=1    ,    __snake_case    :				Any=2    ,    __snake_case    :				Union[str, Any]=2    ,    __snake_case    :				Union[str, Any]=True    ,    __snake_case    :				Tuple=True    ,    **__snake_case    :				str    ,    )       ->   Tuple:
												super().__init__(
												    pad_token_id=__snake_case    ,    bos_token_id=__snake_case    ,    eos_token_id=__snake_case    ,    **__snake_case    ,    )
												_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'''






from typing import TYPE_CHECKING

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


A__       :     Tuple          ={
    '''configuration_mpnet''': ['''MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MPNetConfig'''],
    '''tokenization_mpnet''': ['''MPNetTokenizer'''],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__       :     Tuple          =['''MPNetTokenizerFast''']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__       :     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:
      A__       :     str          =[
          '''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

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






