





import warnings

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


_SCREAMING_SNAKE_CASE 		=						logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE 		=						{
    """xlnet-base-cased""": """https://huggingface.co/xlnet-base-cased/resolve/main/config.json""",
    """xlnet-large-cased""": """https://huggingface.co/xlnet-large-cased/resolve/main/config.json""",
}
class SCREAMING_SNAKE_CASE_  (   snake_case_   ):
						__magic_name__:     Union[str, Any]	 =    "xlnet"
						__magic_name__:     Optional[Any]	 =    ["mems"]
						__magic_name__:     Any	 =    {
						    "n_token": "vocab_size",  # Backward compatibility
						    "hidden_size": "d_model",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}






						def __init__( self : Any						,				_A : int=32000						,				_A : List[Any]=1024						,				_A : str=24						,				_A : Tuple=16						,				_A : Tuple=4096						,				_A : Union[str, Any]="gelu"						,				_A : Any=True						,				_A : List[str]="bi"						,				_A : List[Any]=0.0_2						,				_A : int=1E-12						,				_A : Optional[Any]=0.1						,				_A : Any=512						,				_A : Tuple=None						,				_A : Optional[Any]=True						,				_A : Optional[int]=False						,				_A : List[str]=False						,				_A : List[Any]=-1						,				_A : Optional[int]=False						,				_A : str="last"						,				_A : Union[str, Any]=True						,				_A : int="tanh"						,				_A : Union[str, Any]=0.1						,				_A : Optional[int]=5						,				_A : Dict=5						,				_A : Optional[int]=5						,				_A : Optional[Any]=1						,				_A : Optional[int]=2						,				**_A : Tuple						,				)							->      int:







							"""simple docstring"""


							snake_case_						:     Optional[Any]     =		vocab_size
							snake_case_						:     str     =		d_model
							snake_case_						:     int     =		n_layer
							snake_case_						:     Optional[Any]     =		n_head
							if d_model % n_head != 0:
								raise ValueError(F"""'d_model % n_head' ({d_model % n_head}) should be equal to 0"""		)
							if "d_head" in kwargs:
								if kwargs["d_head"] != d_model // n_head:
									raise ValueError(
									    F"""`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})"""		)
							snake_case_						:     Tuple     =		d_model // n_head
							snake_case_						:     List[Any]     =		ff_activation
							snake_case_						:     Any     =		d_inner
							snake_case_						:     Optional[int]     =		untie_r
							snake_case_						:     List[str]     =		attn_type

							snake_case_						:     List[Any]     =		initializer_range
							snake_case_						:     Optional[int]     =		layer_norm_eps

							snake_case_						:     Optional[Any]     =		dropout
							snake_case_						:     Union[str, Any]     =		mem_len
							snake_case_						:     Any     =		reuse_len
							snake_case_						:     int     =		bi_data
							snake_case_						:     List[str]     =		clamp_len
							snake_case_						:     Any     =		same_length

							snake_case_						:     int     =		summary_type
							snake_case_						:     List[str]     =		summary_use_proj
							snake_case_						:     Any     =		summary_activation
							snake_case_						:     Any     =		summary_last_dropout
							snake_case_						:     Optional[int]     =		start_n_top
							snake_case_						:     Tuple     =		end_n_top

							snake_case_						:     Any     =		bos_token_id
							snake_case_						:     List[str]     =		pad_token_id
							snake_case_						:     Optional[int]     =		eos_token_id

							if "use_cache" in kwargs:
								warnings.warn(
								    'The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'
								    ' instead.'						,				_A						,				)
								snake_case_						:     Union[str, Any]     =		kwargs['use_cache']

							snake_case_						:     List[Any]     =		use_mems_eval
							snake_case_						:     Tuple     =		use_mems_train
							super().__init__(pad_token_id=_A						,				bos_token_id=_A						,				eos_token_id=_A						,				**_A		)






						@property
						def UpperCAmelCase_			( self : Dict		)							->      List[Any]:







							"""simple docstring"""


							logger.info(F"""The model {self.model_type} is one of the few models that has no sequence length limit."""		)
							return -1






						@max_position_embeddings.setter
						def UpperCAmelCase_			( self : Any						,				_A : int		)							->      Dict:







							"""simple docstring"""


							raise NotImplementedError(
							    F"""The model {self.model_type} is one of the few models that has no sequence length limit."""		)








import warnings

from ..trainer import Trainer
from ..utils import logging


_SCREAMING_SNAKE_CASE 		=						logging.get_logger(__name__)
class SCREAMING_SNAKE_CASE_  (   snake_case_   ):






						def __init__( self : Any						,				_A : str=None						,				**_A : Union[str, Any]		)							->      Any:







							"""simple docstring"""


							warnings.warn(
							    '`SageMakerTrainer` is deprecated and will be removed in v5 of Transformers. You can use `Trainer` '
							    'instead.'						,				_A						,				)
							super().__init__(args=_A						,				**_A		)

