





'''simple docstring'''




from typing import TYPE_CHECKING

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


__UpperCAmelCase         =   {
    """configuration_openai""": ["""OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """OpenAIGPTConfig"""],
    """tokenization_openai""": ["""OpenAIGPTTokenizer"""],
}

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

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__UpperCAmelCase         =   [
							    """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:
							__UpperCAmelCase         =   [
							    """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

							__UpperCAmelCase         =   _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)










'''simple docstring'''




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


__UpperCAmelCase         =   logging.get_logger(__name__)

__UpperCAmelCase         =   {
    """uw-madison/yoso-4096""": """https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json""",
    # See all YOSO models at https://huggingface.co/models?filter=yoso
}




class       UpperCamelCase__			(			lowercase_	):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__						=					'''yoso'''


					def __init__(		self							:	str     ,		lowerCamelCase_							:	Tuple=5_02_65     ,		lowerCamelCase_							:	int=7_68     ,		lowerCamelCase_							:	Optional[Any]=12     ,		lowerCamelCase_							:	int=12     ,		lowerCamelCase_							:	Optional[Any]=30_72     ,		lowerCamelCase_							:	str="gelu"     ,		lowerCamelCase_							:	Union[str, Any]=0.1     ,		lowerCamelCase_							:	int=0.1     ,		lowerCamelCase_							:	Optional[int]=40_96     ,		lowerCamelCase_							:	str=1     ,		lowerCamelCase_							:	str=0.02     ,		lowerCamelCase_							:	Dict=1e-12     ,		lowerCamelCase_							:	Tuple="absolute"     ,		lowerCamelCase_							:	Any=True     ,		lowerCamelCase_							:	Dict=9     ,		lowerCamelCase_							:	Any=64     ,		lowerCamelCase_							:	Union[str, Any]=None     ,		lowerCamelCase_							:	List[str]=True     ,		lowerCamelCase_							:	Dict=True     ,		lowerCamelCase_							:	int=1     ,		lowerCamelCase_							:	Tuple=0     ,		lowerCamelCase_							:	Dict=2     ,		**lowerCamelCase_							:	Tuple     ,		):

							'''simple docstring'''



							super().__init__(pad_token_id=lowerCamelCase_     ,		bos_token_id=lowerCamelCase_     ,		eos_token_id=lowerCamelCase_     ,		**lowerCamelCase_		)

							SCREAMING_SNAKE_CASE				:							int						=	vocab_size
							SCREAMING_SNAKE_CASE				:							List[Any]						=	max_position_embeddings
							SCREAMING_SNAKE_CASE				:							Tuple						=	hidden_size
							SCREAMING_SNAKE_CASE				:							Dict						=	num_hidden_layers
							SCREAMING_SNAKE_CASE				:							Any						=	num_attention_heads
							SCREAMING_SNAKE_CASE				:							int						=	intermediate_size
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	hidden_act
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	hidden_dropout_prob
							SCREAMING_SNAKE_CASE				:							List[Any]						=	attention_probs_dropout_prob
							SCREAMING_SNAKE_CASE				:							str						=	initializer_range
							SCREAMING_SNAKE_CASE				:							List[str]						=	type_vocab_size
							SCREAMING_SNAKE_CASE				:							List[str]						=	layer_norm_eps
							SCREAMING_SNAKE_CASE				:							Any						=	position_embedding_type
							SCREAMING_SNAKE_CASE				:							Optional[int]						=	use_expectation
							SCREAMING_SNAKE_CASE				:							int						=	hash_code_len
							SCREAMING_SNAKE_CASE				:							Union[str, Any]						=	num_hash
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	conv_window
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	use_fast_hash
							SCREAMING_SNAKE_CASE				:							Optional[int]						=	lsh_backward



