How to upload a model card through the API?

I found examples for uploading model cards solely through the web interface.
Is it possible to also upload them through the API?

1 Like

Hi,

Model cards are just Markdown files (.md), which you can upload programmatically using the huggingface_hub Python library.

Check the guide here: Upload files to the Hub

1 Like

note that we also have helpers to just update the metadata part of the model card (i.e. the YAML part), if you want to

1 Like