nemo_rl.data.energon.multimodal.registry#

Module Contents#

Classes#

ComponentConfig

Configuration fields shared by task encoders and cookers.

LazyRegistryEntry

Import path and stable implementation version for one registry key.

LazyRegistry

Resolve configured components inside the process that owns the loader.

Functions#

selected_registry_identity

Return stable identity data for all configured multimodal components.

Data#

API#

nemo_rl.data.energon.multimodal.registry.RegistryKind#

None

class nemo_rl.data.energon.multimodal.registry.ComponentConfig#

Bases: typing.Protocol

Configuration fields shared by task encoders and cookers.

name: str | None#

None

python_file: str | None#

None

object_name: str | None#

None

class nemo_rl.data.energon.multimodal.registry.LazyRegistryEntry#

Import path and stable implementation version for one registry key.

import_path: str#

None

version: str#

None

class nemo_rl.data.energon.multimodal.registry.LazyRegistry(
kind: nemo_rl.data.energon.multimodal.registry.RegistryKind,
)#

Resolve configured components inside the process that owns the loader.

Initialization

register(key: str, *, import_path: str, version: str) → None#

Register one unused key without importing its implementation.

resolve(key: str) → Any#

Import and type-check one configured implementation.

resolve_configured(
config: nemo_rl.data.energon.multimodal.registry.ComponentConfig,
) → Any#

Resolve the configured built-in key or object from a Python file.

identity(key: str) → dict[str, str]#

Return stable fingerprint data without importing the implementation.

configured_identity(
config: nemo_rl.data.energon.multimodal.registry.ComponentConfig,
) → dict[str, str]#

Return resume identity for the configured built-in or file-backed plugin.

resolve_for_model_family(
key: str,
*,
model_family: nemo_rl.data.energon.multimodal.model_families.ModelFamily,
) → Any#

Resolve a cooker or task encoder and validate its model family.

resolve_configured_for_model_family(
config: nemo_rl.data.energon.multimodal.registry.ComponentConfig,
*,
model_family: nemo_rl.data.energon.multimodal.model_families.ModelFamily,
) → Any#

Resolve a configured component and validate its model family.

_validate_model_family(
label: str,
resolved: Any,
model_family: nemo_rl.data.energon.multimodal.model_families.ModelFamily,
) → Any#
_file_details(python_file: str | None) → tuple[pathlib.Path, str]#
static _source_bytes(path: pathlib.Path) → bytes#

Return one digest input for a standalone module or plugin package.

_load_file_module(path: pathlib.Path, digest: str) → types.ModuleType#
_validate(key: str, resolved: Any) → None#
nemo_rl.data.energon.multimodal.registry.COOKER_REGISTRY#

‘LazyRegistry(…)’

nemo_rl.data.energon.multimodal.registry.TASK_ENCODER_REGISTRY#

‘LazyRegistry(…)’

nemo_rl.data.energon.multimodal.registry.selected_registry_identity(
*,
task_encoder: nemo_rl.data.energon.multimodal.registry.ComponentConfig,
cookers: collections.abc.Sequence[nemo_rl.data.energon.multimodal.registry.ComponentConfig],
) → dict[str, Any]#

Return stable identity data for all configured multimodal components.

nemo_rl.data.energon.multimodal.registry.__all__#

[‘COOKER_REGISTRY’, ‘ComponentConfig’, ‘LazyRegistry’, ‘LazyRegistryEntry’, ‘TASK_ENCODER_REGISTRY’,…