
import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


__lowerCAmelCase					   =       parse(importlib.metadata.version('torch'))


def    a      ( a		,						a		,						a	)     ->Union[str, Any]:




			'''simple docstring'''


			if operation not in STR_OPERATION_TO_FUNC.keys():
						raise ValueError(F"""`operation` must be one of {list(STR_OPERATION_TO_FUNC.keys()	)}, received {operation}"""	)
			SCREAMING_SNAKE_CASE     						= STR_OPERATION_TO_FUNC[operation]
			if isinstance(a		,						a	):
						SCREAMING_SNAKE_CASE     						= parse(importlib.metadata.version(a	)	)
			return operation(a		,						parse(a	)	)





def    a      ( a		,						a	)     ->Tuple:




			'''simple docstring'''


			return compare_versions(a		,						a		,						a	)

from typing import TYPE_CHECKING

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


__lowerCAmelCase					   =       {
    'configuration_bloom': ['BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BloomConfig', 'BloomOnnxConfig'],
}
try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase					   =       ['BloomTokenizerFast']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase					   =       [
							    'BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'BloomForCausalLM',
							    'BloomModel',
							    'BloomPreTrainedModel',
							    'BloomForSequenceClassification',
							    'BloomForTokenClassification',
							    'BloomForQuestionAnswering',
							]

if TYPE_CHECKING:
							from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_bloom_fast import BloomTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_bloom import (
														    BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    BloomForCausalLM,
														    BloomForQuestionAnswering,
														    BloomForSequenceClassification,
														    BloomForTokenClassification,
														    BloomModel,
														    BloomPreTrainedModel,
														)

else:
							import sys

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