





'''simple docstring'''





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


lowercase_		:				int				=						logging.get_logger(__name__)

lowercase_		:				Optional[int]				=						{
    '''transfo-xl-wt103''': '''https://huggingface.co/transfo-xl-wt103/resolve/main/config.json''',
}


class 			lowercase				(							a_     ):



						"""simple docstring"""

						_UpperCamelCase  :	Dict								=	"transfo-xl"
						_UpperCamelCase  :	Dict								=	["mems"]
						_UpperCamelCase  :	Union[str, Any]								=	{
						    "n_token": "vocab_size",
						    "hidden_size": "d_model",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}







						def __init__(    self			:		int ,				lowerCamelCase_			:		List[str]=26_77_35 ,				lowerCamelCase_			:		List[str]=[2_00_00, 4_00_00, 20_00_00] ,				lowerCamelCase_			:		List[Any]=10_24 ,				lowerCamelCase_			:		Dict=10_24 ,				lowerCamelCase_			:		Union[str, Any]=16 ,				lowerCamelCase_			:		int=64 ,				lowerCamelCase_			:		List[Any]=40_96 ,				lowerCamelCase_			:		str=4 ,				lowerCamelCase_			:		Optional[Any]=False ,				lowerCamelCase_			:		Optional[int]=18 ,				lowerCamelCase_			:		List[Any]=16_00 ,				lowerCamelCase_			:		Dict=10_00 ,				lowerCamelCase_			:		int=True ,				lowerCamelCase_			:		Tuple=True ,				lowerCamelCase_			:		Any=0 ,				lowerCamelCase_			:		str=-1 ,				lowerCamelCase_			:		List[Any]=True ,				lowerCamelCase_			:		int=0.1 ,				lowerCamelCase_			:		Optional[int]=0.0 ,				lowerCamelCase_			:		Any=True ,				lowerCamelCase_			:		List[str]="normal" ,				lowerCamelCase_			:		Union[str, Any]=0.01 ,				lowerCamelCase_			:		Optional[int]=0.01 ,				lowerCamelCase_			:		int=0.02 ,				lowerCamelCase_			:		Optional[int]=1e-5 ,				lowerCamelCase_			:		int=0 ,				**lowerCamelCase_			:		List[Any] ,				):





										'''simple docstring'''







										_snake_case :			Union[str, Any]  						=   vocab_size
										_snake_case :			Any  						=   []
										self.cutoffs.extend(lowerCamelCase_					)
										if proj_share_all_but_first:
														_snake_case :			Any  						=   [False] + [True] * len(self.cutoffs					)
										else:
														_snake_case :			Union[str, Any]  						=   [False] + [False] * len(self.cutoffs					)
										_snake_case :			Any  						=   d_model
										_snake_case :			Tuple  						=   d_embed
										_snake_case :			Any  						=   d_head
										_snake_case :			int  						=   d_inner
										_snake_case :			Optional[Any]  						=   div_val
										_snake_case :			Dict  						=   pre_lnorm
										_snake_case :			Optional[Any]  						=   n_layer
										_snake_case :			Optional[int]  						=   n_head
										_snake_case :			Optional[Any]  						=   mem_len
										_snake_case :			Union[str, Any]  						=   same_length
										_snake_case :			str  						=   attn_type
										_snake_case :			str  						=   clamp_len
										_snake_case :			str  						=   sample_softmax
										_snake_case :			str  						=   adaptive
										_snake_case :			int  						=   dropout
										_snake_case :			Optional[Any]  						=   dropatt
										_snake_case :			str  						=   untie_r
										_snake_case :			Dict  						=   init
										_snake_case :			str  						=   init_range
										_snake_case :			Optional[Any]  						=   proj_init_std
										_snake_case :			Optional[Any]  						=   init_std
										_snake_case :			Any  						=   layer_norm_epsilon
										super().__init__(eos_token_id=lowerCamelCase_ ,				**lowerCamelCase_					)







						@property
						def 		__UpperCAmelCase       (    self			:		Union[str, 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			:		str ,				lowerCamelCase_			:		Union[str, Any]					):





										'''simple docstring'''







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













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


lowercase_		:				Optional[Any]				=						{
    '''configuration_roc_bert''': ['''ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RoCBertConfig'''],
    '''tokenization_roc_bert''': ['''RoCBertTokenizer'''],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		pass

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_		:				Tuple				=						[
		    '''ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''RoCBertForCausalLM''',
		    '''RoCBertForMaskedLM''',
		    '''RoCBertForMultipleChoice''',
		    '''RoCBertForPreTraining''',
		    '''RoCBertForQuestionAnswering''',
		    '''RoCBertForSequenceClassification''',
		    '''RoCBertForTokenClassification''',
		    '''RoCBertLayer''',
		    '''RoCBertModel''',
		    '''RoCBertPreTrainedModel''',
		    '''load_tf_weights_in_roc_bert''',
		]

if TYPE_CHECKING:
		from .configuration_roc_bert import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig
		from .tokenization_roc_bert import RoCBertTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				raise OptionalDependencyNotAvailable()

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_roc_bert import (
				    ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    RoCBertForCausalLM,
				    RoCBertForMaskedLM,
				    RoCBertForMultipleChoice,
				    RoCBertForPreTraining,
				    RoCBertForQuestionAnswering,
				    RoCBertForSequenceClassification,
				    RoCBertForTokenClassification,
				    RoCBertLayer,
				    RoCBertModel,
				    RoCBertPreTrainedModel,
				    load_tf_weights_in_roc_bert,
				)


else:
		import sys

		lowercase_		:				Tuple				=						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






