





from typing import TYPE_CHECKING

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


__lowercase							:Optional[Any]							=	{
    "configuration_openai": ["OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig"],
    "tokenization_openai": ["OpenAIGPTTokenizer"],
}

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

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

				__lowercase							:str							=	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
__lowercase							:List[Any]							=	TypeVar("T", bound="Enum")



@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    80
							snake_case_							=    70
							snake_case_							=    60
							snake_case_							=    50
							snake_case_							=    40
							snake_case_							=    30
							snake_case_							=    20
							snake_case_							=    10







@unique
class  _a  (					lowercase__				):






							"""simple docstring"""

							snake_case_							=    24
							snake_case_							=    21
							snake_case_							=    18
							snake_case_							=    15
							snake_case_							=    12
							snake_case_							=    9
							snake_case_							=    6
							snake_case_							=    3
							snake_case_							=    2
							snake_case_							=    1
							snake_case_							=    -1
							snake_case_							=    -2
							snake_case_							=    -3
							snake_case_							=    -6
							snake_case_							=    -9
							snake_case_							=    -12
							snake_case_							=    -15
							snake_case_							=    -18
							snake_case_							=    -21
							snake_case_							=    -24

							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value > 0}






							@classmethod
							def   A_	(   cls					:  type[T]     )						->dict:
													return {unit.name: unit.value for unit in cls if unit.value < 0}







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__  :					str =       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
						for name_prefix, value_prefix in prefixes.items():
												SCREAMING_SNAKE_CASE__  :					str =       value / (10**value_prefix)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {name_prefix}"""
						return str(_lowerCamelCase  )







def    UpperCAmelCase				(  _lowerCamelCase   :	float  ):





						'''simple docstring'''


						for prefix in BinaryUnit:
												SCREAMING_SNAKE_CASE__  :					List[Any] =       value / (2**prefix.value)
												if numerical_part > 1:
																		return f"""{numerical_part!s} {prefix.name}"""
						return str(_lowerCamelCase  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()