Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use attrs/cattrs instead of custom serialization #333

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

cat-state
Copy link
Collaborator

@cat-state cat-state commented Feb 23, 2023

Depends on #306
This PR adds cattrs and attrs usage to remove us having to write custom ser/des code.

To keep supporting the ability to define MethodConfigs and *Trainers outside TRLX however, we need to keep some of the custom serialization/deserialization (rather than just making a Union of all the relevant config types and having cattrs deserialize it)

As a further improvement, we could make *TrainerConfig classes as we have for MethodConfig, and instantiate the trainers from a method on the deserialized *TrainerConfig, rather than a single TrainConfig with a stringly-typed name of the trainer class to instantiate. This would also let us give the different trainers different args as they need rather than getting trainer specific args from MethodConfig (like gen_kwargs)

@cat-state cat-state marked this pull request as draft February 23, 2023 19:51
@cat-state
Copy link
Collaborator Author

Converting to draft for discussion around refactoring and config breakage.

Base automatically changed from remove_ymls to main February 28, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant