nemo_rl.models.policy.utils#

Module Contents#

Functions#

import_class_from_path

Import a class from a string path (e.g. ‘torch.optim.AdamW’).

get_gpu_info

Return information about the GPU being used by this worker.

sliding_window_overwrite

Returns configuration overrides to handle sliding window settings based on model rules.

API#

nemo_rl.models.policy.utils.import_class_from_path(name)[source]#

Import a class from a string path (e.g. ‘torch.optim.AdamW’).

Parameters:

full_path – Full path to class including module path and class name

Returns:

The imported class object

nemo_rl.models.policy.utils.get_gpu_info(model)[source]#

Return information about the GPU being used by this worker.

nemo_rl.models.policy.utils.sliding_window_overwrite(model_name: str) dict[source]#

Returns configuration overrides to handle sliding window settings based on model rules.

Parameters:

model_name – The HuggingFace model name or path to load configuration from

Returns:

Dictionary with overwrite values, or empty dict if no overwrites needed

Return type:

dict