nomic-ai / contrastors

Train Models Contrastively in Pytorch
Apache License 2.0
512 stars 37 forks source link

Unable to get config in mlm pretraining #16

Closed Linhvjc closed 6 months ago

Linhvjc commented 6 months ago

I got an error:

pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.

But I solved it by replacing @root_validator with @root_validator(pre=True) in src/contrastors/config.py

zanussbaum commented 6 months ago

What version of Pydantic are you running? Can you paste pip list?

Linhvjc commented 6 months ago

Oh no! My fault, I have Pydantic > 2.0.0. Thank you!

zanussbaum commented 6 months ago

No worries! If the requirements didn't catch this let me know and I can update :)