Important

You are viewing the NeMo 2.0 documentation. This release introduces significant changes to the API and a new library, NeMo Run. We are currently porting all features from NeMo 1.0 to 2.0. For documentation on previous versions or features not yet available in 2.0, please refer to the NeMo 24.07 documentation.

Configuration#

Configuration Classes#

class nemo_run.config.Config(*args: Any, **kwargs: Any)#

Bases: Generic[_T], ~_T, _CloneAndFNMixin, _VisualizeMixin

Wrapper around fdl.Config with nemo_run specific functionality. See fdl.Config for more.

class nemo_run.config.Partial(*args: Any, **kwargs: Any)#

Bases: Generic[_T], ~_T, _CloneAndFNMixin, _VisualizeMixin

Wrapper around fdl.Partial with nemo_run specific functionality. See fdl.Partial for more.

class nemo_run.config.Script(
path: str = '',
inline: str = '',
args: list[str] = <factory>,
env: dict[str,
str] = <factory>,
shell: str = 'bash',
python: str = 'python',
m: bool = False,
)#

Bases: object

Dataclass to configure raw scripts.

Examples:

file_based_script = run.Script("./scripts/echo.sh")

inline_script = run.Script(
    inline="""
env
echo "Hello 1"
echo "Hello 2"
"""
)
args: list[str]#

Args to pass to your scripts, only applicable when path is set.

env: dict[str, str]#

Environment variables to set when running the script.

get_name()#
inline: str = ''#

Inline contents of the script. Either path or inline needs to be set.

m: bool = False#

Whether to use python -m when executing via python.

path: str = ''#

Path to your script

python: str = 'python'#

Whether to use a python binary to run your script, set shell=”” to activate.

shell: str = 'bash'#

Shell to use, defaults to bash.

to_command(with_entrypoint: bool = False) list[str]#