Skip to content

Question for community: We're considering adding pydantic as a base requirement to 🤗 transformers #36329

Closed
@gante

Description

@gante

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 with import pydantic.v1 as pydantic, and use 1.x syntax.

Let us know your opinion about pydantic!

(Related PR: #35910)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions