model_card_toolkit.ModelCard

Fields used to generate the Model Card.

Inherits From: BaseModelCardField

model_details Descriptive metadata for the model.
model_parameters Technical metadata for the model.
quantitative_analysis Quantitative analysis of model performance.
considerations Any considerations related to model construction, training, and application.

Methods

clear

View source

Clear the subfields of this BaseModelCardField.

copy_from_proto

View source

Copies the contents of the model card proto into current object.

from_json

View source

Reads ModelCard from JSON.

This function will overwrite all existing ModelCard fields.

Args
json_dict A JSON dict from which to populate fields in the model card schema.

Raises
JSONDecodeError If json_dict is not a valid JSON string.
ValidationError If json_dict does not follow the model card JSON schema.
ValueError If json_dict contains a value not in the class or schema definition.

merge_from_json

View source

Reads ModelCard from JSON.

This function will only overwrite ModelCard fields specified in the JSON.

Args
json A JSON object from whichto populate fields in the model card. This can be provided as either a dictionary or a string.

Raises
JSONDecodeError If json_dict is not a valid JSON string.
ValidationError If json_dict does not follow the model card JSON schema.
ValueError If json_dict contains a value not in the class or schema definition.

merge_from_proto

View source

Merges the contents of the model card proto into current object.

to_dict

View source

Convert your model card to a python dictionary.

to_json

View source

Write ModelCard to JSON.

to_proto

View source

Convert this class object to the proto.

__eq__

__len__

View source

Returns the number of items in a field. Ignores None values recursively, so the length of a field that only contains another field that has all None values would be 0.