nemo_export.utils._mock_import#

Module Contents#

Functions#

_mock_import

Context manager to mock the import of a specified module if it is not available.

Data#

LOGGER

Utility to mock imports of unavailable modules.

API#

nemo_export.utils._mock_import.LOGGER = 'getLogger(...)'#

Utility to mock imports of unavailable modules.

Created for the purpose of using NeMo checkpoints produced with nvcr.io/nvidia/nemo:25.02.rc2 containers (or later) and used in the environments where Megatron-Core is not available. This currently includes NIM containers.

nemo_export.utils._mock_import._mock_import(module: str)[source]#

Context manager to mock the import of a specified module if it is not available.

Parameters:

module (str) – The name of the module to mock.

Yields:

Yields control back to the caller.