



import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


UpperCAmelCase__     :   List[str]     = "scheduler_config.json"







class     __lowerCAmelCase					(    __lowerCAmelCase		):
			UpperCamelCase           =  1
			UpperCamelCase           =  2
			UpperCamelCase           =  3
			UpperCamelCase           =  4
			UpperCamelCase           =  5
			UpperCamelCase           =  6
			UpperCamelCase           =  7
			UpperCamelCase           =  8
			UpperCamelCase           =  9
			UpperCamelCase           =  1_0
			UpperCamelCase           =  1_1
			UpperCamelCase           =  1_2
			UpperCamelCase           =  1_3
			UpperCamelCase           =  1_4







@dataclass
class     __lowerCAmelCase					(    __lowerCAmelCase		):
			UpperCamelCase           =  42







class     __lowerCAmelCase					:
			UpperCamelCase           =  SCHEDULER_CONFIG_NAME
			UpperCamelCase           =  []
			UpperCamelCase           =  True



			@classmethod
			def 					_lowerCamelCase (		cls     :						str				,	A     :						int = None				,	A     :						Dict = None				,	A     :						Optional[Any]=False				,	**A     :						Optional[Any]				,	)     ->					List[str]:



						"""simple docstring"""






						_UpperCAmelCase ,  _UpperCAmelCase ,  _UpperCAmelCase	 =     cls.load_config(
						    pretrained_model_name_or_path=lowerCAmelCase_				,	subfolder=lowerCAmelCase_				,	return_unused_kwargs=lowerCAmelCase_				,	return_commit_hash=lowerCAmelCase_				,	**lowerCAmelCase_				,	)
						return cls.from_config(lowerCAmelCase_				,	return_unused_kwargs=lowerCAmelCase_				,	**lowerCAmelCase_)



			def 					_lowerCamelCase (		self     :						Dict				,	A     :						Tuple				,	A     :						Dict = False				,	**A     :						str)     ->					List[Any]:



						"""simple docstring"""






						self.save_config(save_directory=lowerCAmelCase_				,	push_to_hub=lowerCAmelCase_				,	**lowerCAmelCase_)



			@property
			def 					_lowerCamelCase (		self     :						Optional[Any])     ->					List[str]:



						"""simple docstring"""






						return self._get_compatibles()



			@classmethod
			def 					_lowerCamelCase (		cls     :						int)     ->					Tuple:



						"""simple docstring"""






						_UpperCAmelCase	 =     list(set([cls.__name__] + cls._compatibles))
						_UpperCAmelCase	 =     importlib.import_module(__name__.split('.')[0])
						_UpperCAmelCase	 =     [
						    getattr(lowerCAmelCase_				,	lowerCAmelCase_) for c in compatible_classes_str if hasattr(lowerCAmelCase_				,	lowerCAmelCase_)
						]
						return compatible_classes





from typing import TYPE_CHECKING

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


UpperCAmelCase__     = {
    "configuration_ctrl": ["CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig"],
    "tokenization_ctrl": ["CTRLTokenizer"],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__     = [
							    "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "CTRLForSequenceClassification",
							    "CTRLLMHeadModel",
							    "CTRLModel",
							    "CTRLPreTrainedModel",
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__     = [
							    "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TFCTRLForSequenceClassification",
							    "TFCTRLLMHeadModel",
							    "TFCTRLModel",
							    "TFCTRLPreTrainedModel",
							]


if TYPE_CHECKING:
							from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
							from .tokenization_ctrl import CTRLTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_ctrl import (
														    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
														    CTRLForSequenceClassification,
														    CTRLLMHeadModel,
														    CTRLModel,
														    CTRLPreTrainedModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_ctrl import (
														    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFCTRLForSequenceClassification,
														    TFCTRLLMHeadModel,
														    TFCTRLModel,
														    TFCTRLPreTrainedModel,
														)

else:
							import sys

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