class_docstr: This class is a data structure to keep the content in the index.json file for sharded checkpoint.
  
  Example:
      >>> index = CheckpointIndexFile.from_file('model.index.json')
      >>> index.append_metadata('model_type', 'bert')
      >>> index.append_weight_map('bert.embeddings.word_embeddings.weight', 'model_0001-of-0002.bin')
      >>> index.export('new_index.json')
class_docstr_tok: ["This","class","is","a","data","structure","to","keep","the","content","in","the","index.json","file","for","sharded","checkpoint",".","Example",":",">",">",">","index","=","CheckpointIndexFile.from_file","(","'model.index.json","'",")",">",">",">","index.append_metadata","(","'model_type","'",",","'bert","'",")",">",">",">","index.append_weight_map","(","'bert.embeddings.word_embeddings.weight","'",",","'model_0001-of-0002.bin","'",")",">",">",">","index.export","(","'new_index.json","'",")"]
docstr: Export the index file to a json file.
  
  Args:
      json_path (str): path to the json file.
docstr_tok: ["Export","the","index","file","to","a","json","file",".","Args",":","json_path","(","str",")",":","path","to","the","json","file","."]
code: def export(self, json_path: str):
      """
      Export the index file to a json file.
  
      Args:
          json_path (str): path to the json file.
      """
      # create the index file
      index = dict()
      index["metadata"] = self.metadata
      index["weight_map"] = self.weight_map
  
      # export the index file
      with open(json_path, "w") as f:
          json.dump(index, f, indent=4)
  
file_path: ColossalAI/colossalai/checkpoint_io/index_file.py
imports: import json
  import os
  from collections import OrderedDict
  from pathlib import Path
  from typing import Any, Dict, List, Union
  from .utils import is_dtensor_checkpoint
label_desc: Use image node_id 4 for calling the CheckpointIndexFile obj's underlying member method code with example usage: obj.export(json_path) without return types