View source on GitHub |
A collection of graphics.
Inherits From: BaseModelCardField
model_card_toolkit.GraphicsCollection(
description: Optional[str] = None,
collection: List[model_card_toolkit.Graphic
] = dataclasses.field(default_factory=list),
_proto_type: dataclasses.InitVar[type(model_card_pb2.GraphicsCollection)] = model_card_pb2.GraphicsCollection
)
Each graphic
in the collection
field has both a name
and
an image
. For instance, you might want to display a graph showing the
number of examples belonging to each class in your training dataset:
model_card.model_parameters.data.train.graphics.collection = [
{'name': 'Training Set Size', 'image': training_set_size_barchart},
]
Then, provide a description of the graph:
model_card.model_parameters.data.train.graphics.description = (
'This graph displays the number of examples belonging to each class ',
'in the training dataset. ')
Attributes | |
---|---|
description
|
The description of graphics. |
collection
|
A collection of graphics. |
Methods
clear
clear()
Clear the subfields of this BaseModelCardField.
copy_from_proto
copy_from_proto(
proto: message.Message
) -> 'BaseModelCardField'
Copies the contents of the model card proto into current object.
merge_from_proto
merge_from_proto(
proto: message.Message
) -> 'BaseModelCardField'
Merges the contents of the model card proto into current object.
to_dict
to_dict() -> Dict[str, Any]
Convert your model card to a python dictionary.
to_json
to_json() -> str
Convert this class object to json.
to_proto
to_proto() -> message.Message
Convert this class object to the proto.
__eq__
__eq__(
other
)
__len__
__len__() -> int
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.
Class Variables | |
---|---|
description |
None
|