





"""simple docstring"""





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


lowerCAmelCase__        =      logging.get_logger(__name__)

lowerCAmelCase__        =      {
    '''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 							_lowerCamelCase   (							_lowercase			):
						UpperCAmelCase_			=      "reformer"
						UpperCAmelCase_			=      ["past_buckets_states"]
						UpperCAmelCase_			=      {}


						def __init__(self ,				__a=64 ,				__a=["local", "lsh", "local", "lsh", "local", "lsh"] ,				__a=1.0 ,				__a=True ,				__a=[64, 64] ,				__a=[64, 1_92] ,				__a=0 ,				__a=2 ,				__a=5_12 ,				__a=None ,				__a="relu" ,				__a=0.05 ,				__a=2_56 ,				__a=0.02 ,				__a=False ,				__a=1e-1_2 ,				__a=1 ,				__a=0 ,				__a=0.05 ,				__a=64 ,				__a=64 ,				__a=0.0 ,				__a=1 ,				__a=0 ,				__a=40_96 ,				__a=12 ,				__a=None ,				__a=1 ,				__a=0 ,				__a=3_20 ,				__a=False ,				__a=True ,				__a=None ,				**__a ,				)			-> str:
								UpperCamelCase =						hash_seed
								UpperCamelCase =						vocab_size
								UpperCamelCase =						attention_head_size
								UpperCamelCase =						hidden_size
								UpperCamelCase =						num_attention_heads
								UpperCamelCase =						num_hashes
								UpperCamelCase =						len(__a		)
								UpperCamelCase =						tuple(__a		) if isinstance(__a ,				__a		) else num_buckets
								UpperCamelCase =						lsh_attn_chunk_length
								UpperCamelCase =						local_attn_chunk_length
								UpperCamelCase =						lsh_num_chunks_after
								UpperCamelCase =						lsh_num_chunks_before
								UpperCamelCase =						local_num_chunks_after
								UpperCamelCase =						local_num_chunks_before
								UpperCamelCase =						hidden_act
								UpperCamelCase =						feed_forward_size
								UpperCamelCase =						hidden_dropout_prob
								UpperCamelCase =						lsh_attention_probs_dropout_prob
								UpperCamelCase =						local_attention_probs_dropout_prob
								UpperCamelCase =						max_position_embeddings
								UpperCamelCase =						initializer_range
								UpperCamelCase =						layer_norm_eps
								UpperCamelCase =						axial_pos_embds
								UpperCamelCase =						tuple(__a		)
								UpperCamelCase =						tuple(__a		)
								UpperCamelCase =						axial_norm_std
								UpperCamelCase =						chunk_size_lm_head
								UpperCamelCase =						attn_layers
								UpperCamelCase =						use_cache
								UpperCamelCase =						classifier_dropout
								super().__init__(
								    pad_token_id=__a ,				eos_token_id=__a ,				is_decoder=__a ,				tie_word_embeddings=__a ,				**__a ,				)













"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCAmelCase__        =      {
    '''configuration_openai''': ['''OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''OpenAIGPTConfig'''],
    '''tokenization_openai''': ['''OpenAIGPTTokenizer'''],
}

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__        =      ['''OpenAIGPTTokenizerFast''']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__        =      [
						    '''OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''OpenAIGPTDoubleHeadsModel''',
						    '''OpenAIGPTForSequenceClassification''',
						    '''OpenAIGPTLMHeadModel''',
						    '''OpenAIGPTModel''',
						    '''OpenAIGPTPreTrainedModel''',
						    '''load_tf_weights_in_openai_gpt''',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__        =      [
						    '''TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''TFOpenAIGPTDoubleHeadsModel''',
						    '''TFOpenAIGPTForSequenceClassification''',
						    '''TFOpenAIGPTLMHeadModel''',
						    '''TFOpenAIGPTMainLayer''',
						    '''TFOpenAIGPTModel''',
						    '''TFOpenAIGPTPreTrainedModel''',
						]


if TYPE_CHECKING:
						from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig
						from .tokenization_openai import OpenAIGPTTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_openai_fast import OpenAIGPTTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_openai import (
												    OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    OpenAIGPTDoubleHeadsModel,
												    OpenAIGPTForSequenceClassification,
												    OpenAIGPTLMHeadModel,
												    OpenAIGPTModel,
												    OpenAIGPTPreTrainedModel,
												    load_tf_weights_in_openai_gpt,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_openai import (
												    TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFOpenAIGPTDoubleHeadsModel,
												    TFOpenAIGPTForSequenceClassification,
												    TFOpenAIGPTLMHeadModel,
												    TFOpenAIGPTMainLayer,
												    TFOpenAIGPTModel,
												    TFOpenAIGPTPreTrainedModel,
												)

else:
						import sys

						lowerCAmelCase__        =      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






