






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


_UpperCamelCase			:	Dict								=logging.get_logger(__name__)

_UpperCamelCase			:	Any								={
    'transfo-xl-wt103': 'https://huggingface.co/transfo-xl-wt103/resolve/main/config.json',
}






class 						UpperCAmelCase__ (							__snake_case							):
		__snake_case      :       Dict     =   "transfo-xl"
		__snake_case      :       Dict     =   ["mems"]
		__snake_case      :       Any     =   {
		    "n_token": "vocab_size",
		    "hidden_size": "d_model",
		    "num_attention_heads": "n_head",
		    "num_hidden_layers": "n_layer",
		}







		def __init__(					self       ,A__=267735       ,A__=[20000, 40000, 200000]       ,A__=1024       ,A__=1024       ,A__=16       ,A__=64       ,A__=4096       ,A__=4       ,A__=False       ,A__=18       ,A__=1600       ,A__=1000       ,A__=True       ,A__=True       ,A__=0       ,A__=-1       ,A__=True       ,A__=0.1       ,A__=0.0       ,A__=True       ,A__="normal"       ,A__=0.01       ,A__=0.01       ,A__=0.02       ,A__=1E-5       ,A__=0       ,**A__       ,):
						_A	:				Optional[int]   =      vocab_size
						_A	:				Tuple   =      []
						self.cutoffs.extend(A__		)
						if proj_share_all_but_first:
										_A	:				Optional[Any]   =      [False] + [True] * len(self.cutoffs		)
						else:
										_A	:				Optional[Any]   =      [False] + [False] * len(self.cutoffs		)
						_A	:				Optional[Any]   =      d_model
						_A	:				List[str]   =      d_embed
						_A	:				List[str]   =      d_head
						_A	:				List[Any]   =      d_inner
						_A	:				int   =      div_val
						_A	:				Dict   =      pre_lnorm
						_A	:				str   =      n_layer
						_A	:				List[str]   =      n_head
						_A	:				Tuple   =      mem_len
						_A	:				Union[str, Any]   =      same_length
						_A	:				str   =      attn_type
						_A	:				Union[str, Any]   =      clamp_len
						_A	:				Any   =      sample_softmax
						_A	:				Dict   =      adaptive
						_A	:				Any   =      dropout
						_A	:				List[Any]   =      dropatt
						_A	:				List[str]   =      untie_r
						_A	:				Union[str, Any]   =      init
						_A	:				Union[str, Any]   =      init_range
						_A	:				List[str]   =      proj_init_std
						_A	:				str   =      init_std
						_A	:				Tuple   =      layer_norm_epsilon
						super().__init__(eos_token_id=A__       ,**A__		)







		@property
		def  A__      (					self		):
						# Message copied from Transformer-XL documentation
						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  A__      (					self       ,A__		):
						# Message copied from Transformer-XL documentation
						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_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCamelCase			:	Dict								={
    'configuration_albert': ['ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'AlbertConfig', 'AlbertOnnxConfig'],
}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	List[Any]								=['AlbertTokenizer']

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	List[Any]								=['AlbertTokenizerFast']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	Optional[int]								=[
	    'ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'AlbertForMaskedLM',
	    'AlbertForMultipleChoice',
	    'AlbertForPreTraining',
	    'AlbertForQuestionAnswering',
	    'AlbertForSequenceClassification',
	    'AlbertForTokenClassification',
	    'AlbertModel',
	    'AlbertPreTrainedModel',
	    'load_tf_weights_in_albert',
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	List[Any]								=[
	    'TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'TFAlbertForMaskedLM',
	    'TFAlbertForMultipleChoice',
	    'TFAlbertForPreTraining',
	    'TFAlbertForQuestionAnswering',
	    'TFAlbertForSequenceClassification',
	    'TFAlbertForTokenClassification',
	    'TFAlbertMainLayer',
	    'TFAlbertModel',
	    'TFAlbertPreTrainedModel',
	]

try:
	if not is_flax_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	Any								=[
	    'FlaxAlbertForMaskedLM',
	    'FlaxAlbertForMultipleChoice',
	    'FlaxAlbertForPreTraining',
	    'FlaxAlbertForQuestionAnswering',
	    'FlaxAlbertForSequenceClassification',
	    'FlaxAlbertForTokenClassification',
	    'FlaxAlbertModel',
	    'FlaxAlbertPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig, AlbertOnnxConfig

	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_albert import AlbertTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_albert_fast import AlbertTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_albert import (
		    ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    AlbertForMaskedLM,
		    AlbertForMultipleChoice,
		    AlbertForPreTraining,
		    AlbertForQuestionAnswering,
		    AlbertForSequenceClassification,
		    AlbertForTokenClassification,
		    AlbertModel,
		    AlbertPreTrainedModel,
		    load_tf_weights_in_albert,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_albert import (
		    TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFAlbertForMaskedLM,
		    TFAlbertForMultipleChoice,
		    TFAlbertForPreTraining,
		    TFAlbertForQuestionAnswering,
		    TFAlbertForSequenceClassification,
		    TFAlbertForTokenClassification,
		    TFAlbertMainLayer,
		    TFAlbertModel,
		    TFAlbertPreTrainedModel,
		)

	try:
		if not is_flax_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_flax_albert import (
		    FlaxAlbertForMaskedLM,
		    FlaxAlbertForMultipleChoice,
		    FlaxAlbertForPreTraining,
		    FlaxAlbertForQuestionAnswering,
		    FlaxAlbertForSequenceClassification,
		    FlaxAlbertForTokenClassification,
		    FlaxAlbertModel,
		    FlaxAlbertPreTrainedModel,
		)
else:
	import sys

	_UpperCamelCase			:	str								=_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



