-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Question for community: We're considering adding pydantic
as a base requirement to 🤗 transformers
#36329
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
Comments
고맙습니다 |
After some search -- using We can find a few libraries that have both
|
If you can get it ready for v5, then such a change would not be too bad I think. Other libraries should pin <5 then. I am not sure I completely understand how you would use it though. Could you give a small dummy code example? |
I think we would need to be super super cautious & conservative about this. BTW ping @Wauplin and @LysandreJik given we decided against adding |
worst case, can't we vendor a subset of pydantic implementation/code instead? |
We can support both Since we expect the ecosystem to move entirely to v2, we want it to be easy to drop v1 in the future, to do that we can use the We also don’t need to map every feature in Pydantic, we mostly need the validators, the base model configuration, Fields, and serialiazation methods. |
Hi everyone 👋 We've heard your feedback (here and in other social media), and it became clear that Instead, together with This means we will have most benefits (data validation) with no additional dependencies. Stay tuned 🤗 |
I opened huggingface/huggingface_hub#2895 as a suggestion on how to move forward with data validation in the HF ecosystem. Open to feedback and subject to change based on community requirements 🤗 |
Hi everyone! 👋
We want to expand our argument validation in
transformers
to improve the library's overall UX. No one wants to store a config object on the Hub with impossible parameterization or go through the code to find the admissible range for a certain input argument.To that end, we're considering adding
pydantic>=2.0
as a base requirement to 🤗transformers
.Adding a base requirement is not a decision we want to make lightly -- it may place unwanted constraints on downstream projects. We can't anticipate all issues, so we're raising this issue to proactively find them. If
>2.0
is a general issue, we can do a try/except block withimport pydantic.v1 as pydantic
, and use1.x
syntax.Let us know your opinion about
pydantic
!(Related PR: #35910)
The text was updated successfully, but these errors were encountered: