Giter VIP home page Giter VIP logo

modelcards's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.