






'''simple docstring'''







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


_A      :     List[str]       	=logging.get_logger(__name__)

_A      :     Optional[Any]       	={
    '''google/reformer-crime-and-punishment''': (
        '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json'''
    ),
    '''google/reformer-enwik8''': '''https://huggingface.co/google/reformer-enwik8/resolve/main/config.json''',
}

class _lowercase      (							_lowercase						):
							a							 =			"""reformer"""
							a							 =			["""past_buckets_states"""]
							a							 =			{}




							def __init__(				self:							Optional[int]     ,				UpperCamelCase__:							Dict=64     ,				UpperCamelCase__:							Optional[Any]=["local", "lsh", "local", "lsh", "local", "lsh"]     ,				UpperCamelCase__:							Any=1.0     ,				UpperCamelCase__:							Any=True     ,				UpperCamelCase__:							Dict=[64, 64]     ,				UpperCamelCase__:							Union[str, Any]=[64, 192]     ,				UpperCamelCase__:							str=0     ,				UpperCamelCase__:							Tuple=2     ,				UpperCamelCase__:							str=512     ,				UpperCamelCase__:							Tuple=None     ,				UpperCamelCase__:							Optional[int]="relu"     ,				UpperCamelCase__:							str=0.05     ,				UpperCamelCase__:							Tuple=256     ,				UpperCamelCase__:							int=0.02     ,				UpperCamelCase__:							Optional[int]=False     ,				UpperCamelCase__:							List[Any]=1e-12     ,				UpperCamelCase__:							Optional[int]=1     ,				UpperCamelCase__:							Any=0     ,				UpperCamelCase__:							Any=0.05     ,				UpperCamelCase__:							List[str]=64     ,				UpperCamelCase__:							Dict=64     ,				UpperCamelCase__:							Tuple=0.0     ,				UpperCamelCase__:							Dict=1     ,				UpperCamelCase__:							int=0     ,				UpperCamelCase__:							Union[str, Any]=4_096     ,				UpperCamelCase__:							int=12     ,				UpperCamelCase__:							Union[str, Any]=None     ,				UpperCamelCase__:							Union[str, Any]=1     ,				UpperCamelCase__:							Dict=0     ,				UpperCamelCase__:							Union[str, Any]=320     ,				UpperCamelCase__:							Any=False     ,				UpperCamelCase__:							Optional[int]=True     ,				UpperCamelCase__:							List[str]=None     ,				**UpperCamelCase__:							Dict     ,				):
														lowerCamelCase__   :      Any			    =			hash_seed
														lowerCamelCase__   :      Dict			    =			vocab_size
														lowerCamelCase__   :      int			    =			attention_head_size
														lowerCamelCase__   :      Optional[int]			    =			hidden_size
														lowerCamelCase__   :      List[Any]			    =			num_attention_heads
														lowerCamelCase__   :      Any			    =			num_hashes
														lowerCamelCase__   :      Optional[int]			    =			len(UpperCamelCase__	)
														lowerCamelCase__   :      Tuple			    =			tuple(UpperCamelCase__	) if isinstance(UpperCamelCase__     ,				UpperCamelCase__	) else num_buckets
														lowerCamelCase__   :      Union[str, Any]			    =			lsh_attn_chunk_length
														lowerCamelCase__   :      int			    =			local_attn_chunk_length
														lowerCamelCase__   :      int			    =			lsh_num_chunks_after
														lowerCamelCase__   :      Dict			    =			lsh_num_chunks_before
														lowerCamelCase__   :      Union[str, Any]			    =			local_num_chunks_after
														lowerCamelCase__   :      str			    =			local_num_chunks_before
														lowerCamelCase__   :      str			    =			hidden_act
														lowerCamelCase__   :      Any			    =			feed_forward_size
														lowerCamelCase__   :      Optional[int]			    =			hidden_dropout_prob
														lowerCamelCase__   :      Tuple			    =			lsh_attention_probs_dropout_prob
														lowerCamelCase__   :      Any			    =			local_attention_probs_dropout_prob
														lowerCamelCase__   :      Tuple			    =			max_position_embeddings
														lowerCamelCase__   :      int			    =			initializer_range
														lowerCamelCase__   :      int			    =			layer_norm_eps
														lowerCamelCase__   :      Tuple			    =			axial_pos_embds
														lowerCamelCase__   :      List[str]			    =			tuple(UpperCamelCase__	)
														lowerCamelCase__   :      Union[str, Any]			    =			tuple(UpperCamelCase__	)
														lowerCamelCase__   :      List[Any]			    =			axial_norm_std
														lowerCamelCase__   :      Dict			    =			chunk_size_lm_head
														lowerCamelCase__   :      Union[str, Any]			    =			attn_layers
														lowerCamelCase__   :      List[str]			    =			use_cache
														lowerCamelCase__   :      Tuple			    =			classifier_dropout
														super().__init__(
														    pad_token_id=UpperCamelCase__     ,				eos_token_id=UpperCamelCase__     ,				is_decoder=UpperCamelCase__     ,				tie_word_embeddings=UpperCamelCase__     ,				**UpperCamelCase__     ,				)









'''simple docstring'''







from typing import TYPE_CHECKING

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


_A      :     Tuple       	={
    '''configuration_imagegpt''': ['''IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ImageGPTConfig''', '''ImageGPTOnnxConfig''']
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A      :     Dict       	=['''ImageGPTFeatureExtractor''']
			_A      :     Union[str, Any]       	=['''ImageGPTImageProcessor''']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A      :     str       	=[
			    '''IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''ImageGPTForCausalImageModeling''',
			    '''ImageGPTForImageClassification''',
			    '''ImageGPTModel''',
			    '''ImageGPTPreTrainedModel''',
			    '''load_tf_weights_in_imagegpt''',
			]


if TYPE_CHECKING:
			from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_imagegpt import ImageGPTFeatureExtractor
						from .image_processing_imagegpt import ImageGPTImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_imagegpt import (
						    IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    ImageGPTForCausalImageModeling,
						    ImageGPTForImageClassification,
						    ImageGPTModel,
						    ImageGPTPreTrainedModel,
						    load_tf_weights_in_imagegpt,
						)

else:
			import sys

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

