Skip to navigation

nemo_gym.orchestration.executors.utils

View as Markdown

Module Contents

Functions

NameDescription
flatten_export_argsFlatten export settings into shell-quoted +key.path=value tokens that Hydra reads back unchanged.
flatten_run_argsFlatten a nested run config dict into shell-quoted ++key.path=value Hydra override tokens.

Data

_EXPORT_SETTING_NAME

API

nemo_gym.orchestration.executors.utils.flatten_export_args(
settings: dict[str, typing.Any],
prefix: str = ''
) -> list[str]

Flatten export settings into shell-quoted +key.path=value tokens that Hydra reads back unchanged.

Unlike flatten_run_args, which only shell-quotes, each value is encoded for Hydra first, so a string keeps its type and its characters, and numbers, booleans and null keep theirs. The shell quotes are gone by the time Hydra parses the argument, which is why shell quoting alone is not enough.

nemo_gym.orchestration.executors.utils.flatten_run_args(
run: dict[str, typing.Any],
prefix: str = ''
) -> list[str]

Flatten a nested run config dict into shell-quoted ++key.path=value Hydra override tokens.

nemo_gym.orchestration.executors.utils._EXPORT_SETTING_NAME = re.compile('[A-Za-z_][A-Za-z0-9_\\-]*')