import inspect
import warnings
from typing import Any, Dict, Optional, Union

from packaging import version






def     lowerCAmelCase_			(   *_SCREAMING_SNAKE_CASE     :				List[str]		, _SCREAMING_SNAKE_CASE     :				Optional[Union[Dict, Any]] = None		, _SCREAMING_SNAKE_CASE     :				str=True		, _SCREAMING_SNAKE_CASE     :				List[Any]=2			):
						from .. import __version__

						UpperCamelCase_		:							Union[str, Any]  =		take_from
						UpperCamelCase_		:							List[Any]  =		()
						if not isinstance(args[0]		, _SCREAMING_SNAKE_CASE			):
												UpperCamelCase_		:							Tuple  =		(args,)

						for attribute, version_name, message in args:
												if version.parse(version.parse(_SCREAMING_SNAKE_CASE			).base_version			) >= version.parse(_SCREAMING_SNAKE_CASE			):
																		raise ValueError(
																		    f'''The deprecation tuple {(attribute, version_name, message)} should be removed since diffusers\''''
																		    f''' version {__version__} is >= {version_name}'''			)

												UpperCamelCase_		:							Dict  =		None
												if isinstance(_SCREAMING_SNAKE_CASE		, _SCREAMING_SNAKE_CASE			) and attribute in deprecated_kwargs:
																		values += (deprecated_kwargs.pop(_SCREAMING_SNAKE_CASE			),)
																		UpperCamelCase_		:							Optional[Any]  =		f'''The `{attribute}` argument is deprecated and will be removed in version {version_name}.'''
												elif hasattr(_SCREAMING_SNAKE_CASE		, _SCREAMING_SNAKE_CASE			):
																		values += (getattr(_SCREAMING_SNAKE_CASE		, _SCREAMING_SNAKE_CASE			),)
																		UpperCamelCase_		:							str  =		f'''The `{attribute}` attribute is deprecated and will be removed in version {version_name}.'''
												elif deprecated_kwargs is None:
																		UpperCamelCase_		:							List[str]  =		f'''`{attribute}` is deprecated and will be removed in version {version_name}.'''

												if warning is not None:
																		UpperCamelCase_		:							Dict  =		warning + """ """ if standard_warn else """"""
																		warnings.warn(warning + message		, _SCREAMING_SNAKE_CASE		, stacklevel=_SCREAMING_SNAKE_CASE			)

						if isinstance(_SCREAMING_SNAKE_CASE		, _SCREAMING_SNAKE_CASE			) and len(_SCREAMING_SNAKE_CASE			) > 0:
												UpperCamelCase_		:							List[str]  =		inspect.getouterframes(inspect.currentframe()			)[1]
												UpperCamelCase_		:							List[str]  =		call_frame.filename
												UpperCamelCase_		:							Optional[Any]  =		call_frame.lineno
												UpperCamelCase_		:							Any  =		call_frame.function
												UpperCamelCase_,UpperCamelCase_		:							Any  =		next(iter(deprecated_kwargs.items()			)			)
												raise TypeError(f'''{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`'''			)

						if len(_SCREAMING_SNAKE_CASE			) == 0:
												return
						elif len(_SCREAMING_SNAKE_CASE			) == 1:
												return values[0]
						return values







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


SCREAMING_SNAKE_CASE		:     int         =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE		:     Union[str, Any]         =	{
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}

class        UpperCamelCase						(				__a				):
						a__		:List[str]      =			'''megatron-bert'''





						def __init__(self			,     __UpperCamelCase=29_056			,     __UpperCamelCase=1_024			,     __UpperCamelCase=24			,     __UpperCamelCase=16			,     __UpperCamelCase=4_096			,     __UpperCamelCase="gelu"			,     __UpperCamelCase=0.1			,     __UpperCamelCase=0.1			,     __UpperCamelCase=512			,     __UpperCamelCase=2			,     __UpperCamelCase=0.02			,     __UpperCamelCase=1E-1_2			,     __UpperCamelCase=0			,     __UpperCamelCase="absolute"			,     __UpperCamelCase=True			,     **__UpperCamelCase			,     )				->				List[Any]:
												super().__init__(pad_token_id=__UpperCamelCase			,     **__UpperCamelCase						)

												UpperCamelCase_		:							Union[str, Any]  =		vocab_size
												UpperCamelCase_		:							Union[str, Any]  =		hidden_size
												UpperCamelCase_		:							Any  =		num_hidden_layers
												UpperCamelCase_		:							str  =		num_attention_heads
												UpperCamelCase_		:							List[Any]  =		hidden_act
												UpperCamelCase_		:							Dict  =		intermediate_size
												UpperCamelCase_		:							Optional[int]  =		hidden_dropout_prob
												UpperCamelCase_		:							Dict  =		attention_probs_dropout_prob
												UpperCamelCase_		:							Any  =		max_position_embeddings
												UpperCamelCase_		:							str  =		type_vocab_size
												UpperCamelCase_		:							Tuple  =		initializer_range
												UpperCamelCase_		:							List[str]  =		layer_norm_eps
												UpperCamelCase_		:							Tuple  =		position_embedding_type
												UpperCamelCase_		:							Tuple  =		use_cache






