nemo_automodel

View as Markdown

Subpackages

Submodules

Package Contents

Classes

NameDescription
_AliasLoaderLoader that replaces the placeholder module in sys.modules with the
_ModelsAliasFinderRedirect nemo_automodel.models and nemo_automodel.models.*

Functions

NameDescription
__dir__Expose the names of all available submodules for auto-completion.
__getattr__Lazily import and cache selected submodules / exported symbols when accessed.

Data

_LAZY_ATTRS

_MODELS_ALIAS

_MODELS_ALIAS_DOT

_MODELS_TARGET

_MODELS_TARGET_DOT

_SUBMODULES

__all__

API

class nemo_automodel._AliasLoader(
real_name
)

Bases: Loader

Loader that replaces the placeholder module in sys.modules with the canonical module during exec_module.

nemo_automodel._AliasLoader.create_module(
spec
)
nemo_automodel._AliasLoader.exec_module(
module
)
class nemo_automodel._ModelsAliasFinder()

Bases: MetaPathFinder

Redirect nemo_automodel.models and nemo_automodel.models.* to nemo_automodel.components.models and its subpackages.

Installed at the front of sys.meta_path so it intercepts before the default PathFinder. Both import paths resolve to the exact same module objects, avoiding duplication.

nemo_automodel._ModelsAliasFinder.find_spec(
fullname,
path,
target = None
)
nemo_automodel.__dir__() -> list[str]

Expose the names of all available submodules for auto-completion.

nemo_automodel.__getattr__(
name: str
) -> types.ModuleType | typing.Any

Lazily import and cache selected submodules / exported symbols when accessed.

nemo_automodel._LAZY_ATTRS: dict[str, tuple[str, str]] = {'NeMoAutoModelForCausalLM': ('nemo_automodel._transformers.auto_model', 'NeMoAu...
nemo_automodel._MODELS_ALIAS = 'nemo_automodel.models'
nemo_automodel._MODELS_ALIAS_DOT = _MODELS_ALIAS + '.'
nemo_automodel._MODELS_TARGET = 'nemo_automodel.components.models'
nemo_automodel._MODELS_TARGET_DOT = _MODELS_TARGET + '.'
nemo_automodel._SUBMODULES = {'recipes', 'shared', 'components', 'models'}
nemo_automodel.__all__ = sorted([*_SUBMODULES, '__version__', '__package_name__', *(_LAZY_ATTRS.keys())])