





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase__						:      Optional[int]	=    {
    'configuration_nllb_moe': [
        'NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'NllbMoeConfig',
    ]
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowercase__						:      Union[str, Any]	=    [
       'NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST',
       'NllbMoeForConditionalGeneration',
       'NllbMoeModel',
       'NllbMoePreTrainedModel',
       'NllbMoeTop2Router',
       'NllbMoeSparseMLP',
   ]


if TYPE_CHECKING:
   from .configuration_nllb_moe import (
       NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
       NllbMoeConfig,
   )

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_nllb_moe import (
          NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
          NllbMoeForConditionalGeneration,
          NllbMoeModel,
          NllbMoePreTrainedModel,
          NllbMoeSparseMLP,
          NllbMoeTopaRouter,
      )


else:
   import sys

   lowercase__						:      Any	=    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)










'''simple docstring'''

import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


lowercase__						:      List[Any]	=    parse(importlib.metadata.version('torch'))







def  a__    (    lowercase :					Union[str, Version], lowercase :					str, lowercase :					str				)		->		List[str]:





     """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}"""				)
     _UpperCamelCase       =	STR_OPERATION_TO_FUNC[operation]
     if isinstance(lowercase, lowercase				):
          _UpperCamelCase       =	parse(importlib.metadata.version(lowercase				)				)
     return operation(lowercase, parse(lowercase				)				)







def  a__    (    lowercase :					str, lowercase :					str				)		->		List[Any]:





     """simple docstring"""

     return compare_versions(lowercase, lowercase, lowercase				)



