NVIDIA-NeMo / NVIDIA-NeMo/RL

Use `dataclasses` instead of `TypedDict` to handle defaults (but not

Open
#2,102 0 comments 0 reactions 2 assignees Claimed by @NolenLiang View on GitHub
enhancement
Dominant language
Python
Stars
2k
Forks
561
Avg merge
4d 5h
Merged PRs (30d)
145

Description

This is related to https://github.com/NVIDIA-NeMo/RL/issues/1675, but outlines one way to start using dataclasses without losing the benefits of dictionaries.

We have gotten some feedback that it would be good to have a central place for the configs to inherit defaults when new configs are added. We can accomplish this by using dataclasses to essentially serve as the typedict, and then do a `merge(current_config, to_object(config_dataclass_with_defaults)`.

This avoids having to change too much of the code, while obtaining the default behavior.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.