Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[depends on #280] Add method for rendering model cards #281

Closed
wants to merge 3 commits into from

Conversation

codesue
Copy link
Collaborator

@codesue codesue commented May 25, 2023

What does this pull request do?

Adds a method for rendering model cards. This allows you to render a model card by calling model_card.render() without first having to first create a ModelCardToolkit object and scaffold assets (which copies default template files and creates a model card proto). Additionally, saving the rendered model card document to a file is optional with this method.

Current usage:

import model_card_toolkit as mct

toolkit = mct.ModelCardToolkit()
model_card = toolkit.scaffold_assets()
model_card.model_details.name = 'My Model'
model_card_html = toolkit.export_format()

With this change:

import model_card_toolkit as mct

model_card = mct.ModelCard()
model_card.model_details.name = 'My Model'
model_card_html = model_card.render()

Relates to #276.

How did you test this change?

Added unit tests and ran pytest model_card_toolkit.
Example notebook: https://colab.research.google.com/gist/codesue/e315e2d79d564ed60a454b8509ca3c31/dev.ipynb

How did you document this change?

Docstrings

Before submitting

Before submitting a pull request, please be sure to do the following:

  • Read the How to Contribute guide if this is your first contribution.
  • Open an issue or discussion topic to discuss this change.
  • Write new tests if applicable.
  • Update documentation if applicable.

@codesue codesue closed this May 25, 2023
@codesue codesue deleted the codesue/rendering branch May 25, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant