Skip to content

Migrate to pydantic 2.0+ - #73

Merged
hmacdope merged 8 commits into
mainfrom
pydantic_2.0
Oct 10, 2024
Merged

Migrate to pydantic 2.0+#73
hmacdope merged 8 commits into
mainfrom
pydantic_2.0

Conversation

@hmacdope

Copy link
Copy Markdown
Contributor

Fixes #72

Status

  • Ready to go

@hmacdope

Copy link
Copy Markdown
Contributor Author

@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.

@hmacdope
hmacdope requested a review from kaminow October 10, 2024 04:29

@kaminow kaminow left a comment

Copy link
Copy Markdown
Collaborator

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!

Comment thread mtenn/config.py Outdated
values[p] = values[p] * num_layers

return values
return self.__dict__.update(values)

Copy link
Copy Markdown
Collaborator

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

Suggested change
return self.__dict__.update(values)
self.__dict__.update(values)
return self.__dict__

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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.

@hmacdope
hmacdope merged commit 36b9f8b into main Oct 10, 2024
@hmacdope
hmacdope deleted the pydantic_2.0 branch October 10, 2024 20:06
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.

Bump to pydantic 2.0+

2 participants