def METHOD_NAME(self, json_path: str):
    """
    Load the index file from a json file.
    Args:
        json_path (str): path to the json file.
    """
    # load the json file
    with open(json_path, 'r') as f:
        index = json.METHOD_NAME(f)
    # assign attributes if exists
    if "metadata" in index:
        self.metadata = index["metadata"]
    if "weight_map" in index:
        self.weight_map = index["weight_map"]
    # assign the root directory for the index file
    self.root_path = Path(json_path).absolute().parent