

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


_lowerCAmelCase      :    Optional[Any]						       =    logging.get_logger(__name__)

_lowerCAmelCase      :    str						       =    {
    "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 			__magic_name__					(    lowerCAmelCase_   ):
			SCREAMING_SNAKE_CASE							     =		'opt'
			SCREAMING_SNAKE_CASE							     =		['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.02      ,						__snake_case=True      ,						__snake_case=1      ,						__snake_case=2      ,						__snake_case=2      ,						__snake_case=True      ,						__snake_case=True      ,						**__snake_case      ,						)     ->				int:




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









from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


_lowerCAmelCase      :    Union[str, Any]						       =    {
    "configuration_ernie_m": ["ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieMConfig"],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCAmelCase      :    str						       =    ["ErnieMTokenizer"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCAmelCase      :    Optional[Any]						       =    [
						    "ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "ErnieMForMultipleChoice",
						    "ErnieMForQuestionAnswering",
						    "ErnieMForSequenceClassification",
						    "ErnieMForTokenClassification",
						    "ErnieMModel",
						    "ErnieMPreTrainedModel",
						    "ErnieMForInformationExtraction",
						]


if TYPE_CHECKING:
						from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_ernie_m import ErnieMTokenizer

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_ernie_m import (
												    ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ErnieMForInformationExtraction,
												    ErnieMForMultipleChoice,
												    ErnieMForQuestionAnswering,
												    ErnieMForSequenceClassification,
												    ErnieMForTokenClassification,
												    ErnieMModel,
												    ErnieMPreTrainedModel,
												)


else:
						import sys

						_lowerCAmelCase      :    Tuple						       =    _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






