class_docstr: ModelCardToolkit provides utilities to generate a ModelCard.
  
  ModelCardToolkit is a tool for ML practitioners to create Model Cards,
  documentation for model information such as owners, use cases, training and
  evaluation data, performance, etc. A Model Card document can be displayed in
  output formats including HTML, Markdown, etc.
  
  The ModelCardToolkit includes an API designed for a human-in-the-loop process
  to elaborate the ModelCard. If model training is integrated with ML Metadata
  (e.g., TFX pipelines), the ModelCardToolkit can further populate ModelCard
  fields by extract metadata and lineage from the model's MLMD instance.
  
  The ModelCardToolkit organizes the ModelCard assets (e.g., structured data,
  plots, and UI templates) in a user-specified directory, and updates them
  incrementally via its API.
  
  
  Standard workflow:
  
  ```python
  import model_card_toolkit as mct
  
  # Initialize the Model Card Toolkit with a path to store generate assets
  model_card_dir_path = ...
  toolkit = mct.ModelCardToolkit(model_card_dir_path)
  
  # Initialize the ModelCard, which can be freely populated
  model_card = toolkit.scaffold_assets()
  model_card.model_details.name = 'My Model'
  
  # Write the model card data to a proto file
  toolkit.update_model_card(model_card)
  
  # Return the model card document as an HTML page
  html = toolkit.export_format()
  ```
class_docstr_tok: ["ModelCardToolkit","provides","utilities","to","generate","a","ModelCard",".","ModelCardToolkit","is","a","tool","for","ML","practitioners","to","create","Model","Cards",",","documentation","for","model","information","such","as","owners",",","use","cases",",","training","and","evaluation","data",",","performance",",","etc",".","A","Model","Card","document","can","be","displayed","in","output","formats","including","HTML",",","Markdown",",","etc",".","The","ModelCardToolkit","includes","an","API","designed","for","a","human-in-the-loop","process","to","elaborate","the","ModelCard",".","If","model","training","is","integrated","with","ML","Metadata","(","e.g.",",","TFX","pipelines",")",",","the","ModelCardToolkit","can","further","populate","ModelCard","fields","by","extract","metadata","and","lineage","from","the","model","'s","MLMD","instance",".","The","ModelCardToolkit","organizes","the","ModelCard","assets","(","e.g.",",","structured","data",",","plots",",","and","UI","templates",")","in","a","user-specified","directory",",","and","updates","them","incrementally","via","its","API",".","Standard","workflow",":","``","`","python","import","model_card_toolkit","as","mct","#","Initialize","the","Model","Card","Toolkit","with","a","path","to","store","generate","assets","model_card_dir_path","=","...","toolkit","=","mct.ModelCardToolkit","(","model_card_dir_path",")","#","Initialize","the","ModelCard",",","which","can","be","freely","populated","model_card","=","toolkit.scaffold_assets","(",")","model_card.model_details.name","=","'My","Model'","#","Write","the","model","card","data","to","a","proto","file","toolkit.update_model_card","(","model_card",")","#","Return","the","model","card","document","as","an","HTML","page","html","=","toolkit.export_format","(",")","``","`"]
docstr: Updates the Proto file in the MCT assets directory.
  
  Args:
    model_card: The updated model card to write back.
  
  Raises:
     Error: when the given model_card is invalid w.r.t. the schema.
docstr_tok: ["Updates","the","Proto","file","in","the","MCT","assets","directory",".","Args",":","model_card",":","The","updated","model","card","to","write","back",".","Raises",":","Error",":","when","the","given","model_card","is","invalid","w.r.t",".","the","schema","."]
code: def update_model_card(
      self, model_card: Union[ModelCard, model_card_pb2.ModelCard]
  ) -> None:
      """Updates the Proto file in the MCT assets directory.
  
      Args:
        model_card: The updated model card to write back.
  
      Raises:
         Error: when the given model_card is invalid w.r.t. the schema.
      """
      if isinstance(model_card, ModelCard):
          model_card = model_card.to_proto()
      io_utils.write_proto_file(self._mcta_proto_file, model_card)
  
file_path: model-card-toolkit/model_card_toolkit/core.py
imports: import logging
  import os
  import pkgutil
  import tempfile
  from typing import Any, Dict, Optional, Union
  from model_card_toolkit import dependencies
  from model_card_toolkit.model_card import ModelCard, load_model_card
  from model_card_toolkit.proto import model_card_pb2
  from model_card_toolkit.utils import io_utils
label_desc: Use image node_id 8 for calling the ModelCardToolkit obj's underlying member method code with example usage: obj.update_model_card(model_card) without return types