Skip to content

๐Ÿ“ Utility to create, edit, and publish model cards on the Hugging Face Hub.

Notifications You must be signed in to change notification settings

adrinjalali/modelcards

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

modelcards

Open In Colab

๐Ÿ“ Utility to create, edit, and publish model cards on the Hugging Face Hub.

This repo is just an idea for now! :)

Usage

Installation

pip install modelcards

Examples

Load a model card from a Hugging Face Hub repo:

from modelcards import ModelCard

card = ModelCard.load("nateraw/rare-puppers")

# Access its card data
print(card.data)

# Update its card data
card.data["library_name"] = "timm"

# Save it to a file
card.save("my_card.md")

# Or, push it to the hub directly to replace the existing card
card.push_to_hub("nateraw/rare-puppers")

Make model cards from the default model card template.

from modelcards import ModelCard

repo_id = "nateraw/my-cool-model-with-card"

# Write/overwrite the model card in that repo
card = ModelCard.from_template(
    language='en',
    license='mit',
    library_name='timm',
    tags=['image-classification', 'resnet'],
    dataset='imagenet',
    metrics=['acc', 'f1'],
    model_id=repo_id.split('/')[-1],  # Included in the template
    model_description="Some really helpful description...",  # Included in the template
)

๐Ÿ‘€ You can see what the resulting model card here looks like at this Hugging Face Hub repo.

Note: you can make your own template and supply that to the from_template method by using the template_path argument.

TODOs

  • Support evaluation metrics
  • Data validation on card data

About

๐Ÿ“ Utility to create, edit, and publish model cards on the Hugging Face Hub.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 88.9%
  • Python 11.1%