nateraw / modelcards

📝 Utility to create, edit, and publish model cards on the Hugging Face Hub. [**Now lives in huggingface_hub**]
MIT License
15 stars 4 forks source link

Determine how to deal with type validation in card metadata #6

Closed nateraw closed 2 years ago

nateraw commented 2 years ago

How do we want to deal with card data validation? Dataclasses are a great way to give type hints, but they don't do any validation. Is this a complex enough use case to use pydantic? I think it would make our lives easier, but I'm concerned the dependency won't be welcomed in huggingface_hub if this code gets integrated there down the line.

CC @adrinjalali

nateraw commented 2 years ago

Right now, in my PR (#5 ) I'm using dataclasses. I could add a __post_init__ and do validation there potentially.

adrinjalali commented 2 years ago

I would do a card.validate() kinda thing where we do the validation, and yeah we probably don't wanna use pydantic.

nateraw commented 2 years ago

Closing this and moving the conversation to #2