-
Notifications
You must be signed in to change notification settings - Fork 1
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
Migrate to pydantic 2.0+ #73
Conversation
@kaminow could I grab a review here? This should allow us to migrate nicely and unblock downstream, but please double check everything still works as expected for configs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing to address but otherwise looks good. thanks for doing this!
mtenn/config.py
Outdated
|
||
# Adjust any length 1 list to be the right length | ||
for p, list_len in list_lens.items(): | ||
if list_len == 1: | ||
values[p] = values[p] * num_layers | ||
|
||
return values | ||
return self.__dict__.update(values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think update
actually returns anything
return self.__dict__.update(values) | |
self.__dict__.update(values) | |
return self.__dict__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you mention it we should return self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is due to how the after
mode validator works in pydantic 2.
Fixes #72
Status