





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_      							=     """scheduler_config.json"""
class 			UpperCamelCase_		(  _lowerCamelCase					):
					lowerCAmelCase_							=	1
					lowerCAmelCase_							=	2
					lowerCAmelCase_							=	3
					lowerCAmelCase_							=	4
					lowerCAmelCase_							=	5
					lowerCAmelCase_							=	6
					lowerCAmelCase_							=	7
					lowerCAmelCase_							=	8
					lowerCAmelCase_							=	9
					lowerCAmelCase_							=	10
					lowerCAmelCase_							=	11
					lowerCAmelCase_							=	12
					lowerCAmelCase_							=	13
					lowerCAmelCase_							=	14





@dataclass
class 			UpperCamelCase_		(  _lowerCamelCase					):
					lowerCAmelCase_							=	42





class 			UpperCamelCase_		:
					lowerCAmelCase_							=	SCHEDULER_CONFIG_NAME
					lowerCAmelCase_							=	[]
					lowerCAmelCase_							=	True




					@classmethod
					def 	lowerCAmelCase			(		cls				,						lowerCAmelCase_ = None				,						lowerCAmelCase_ = None				,						lowerCAmelCase_=False				,						**lowerCAmelCase_				,						)		->							Optional[int]:
										_snake_case							,     _snake_case							,     _snake_case									=				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				,						lowerCAmelCase_				,						lowerCAmelCase_ = False				,						**lowerCAmelCase_  )		->							Tuple:
										self.save_config(save_directory=lowerCAmelCase_				,						push_to_hub=lowerCAmelCase_				,						**lowerCAmelCase_  )




					@property
					def 	lowerCAmelCase			(		self  )		->							Tuple:
										return self._get_compatibles()






					@classmethod
					def 	lowerCAmelCase			(		cls  )		->							List[str]:
										_snake_case									=				list(set([cls.__name__] + cls._compatibles  )  )
										_snake_case									=				importlib.import_module(__name__.split('.'  )[0]  )
										_snake_case									=				[
										    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_torch_available


UpperCAmelCase_      							=     {
    """configuration_bigbird_pegasus""": [
        """BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BigBirdPegasusConfig""",
        """BigBirdPegasusOnnxConfig""",
    ],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_      							=     [
					    """BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """BigBirdPegasusForCausalLM""",
					    """BigBirdPegasusForConditionalGeneration""",
					    """BigBirdPegasusForQuestionAnswering""",
					    """BigBirdPegasusForSequenceClassification""",
					    """BigBirdPegasusModel""",
					    """BigBirdPegasusPreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_bigbird_pegasus import (
					    BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    BigBirdPegasusConfig,
					    BigBirdPegasusOnnxConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_bigbird_pegasus import (
										    BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
										    BigBirdPegasusForCausalLM,
										    BigBirdPegasusForConditionalGeneration,
										    BigBirdPegasusForQuestionAnswering,
										    BigBirdPegasusForSequenceClassification,
										    BigBirdPegasusModel,
										    BigBirdPegasusPreTrainedModel,
										)


else:
					import sys

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



