class_docstr: Builder class for the MMapIndexedDataset class
  
  Args:
      bin_path (str): The path to the data (.bin) file
  
      dtype (Type[numpy.number], optional): The dtype of the index file. Defaults to numpy.int32.
  
      multimodal (bool, optional): Whether the dataset is multimodal. Defaults to False.
class_docstr_tok: ["Builder","class","for","the","MMapIndexedDataset","class","Args",":","bin_path","(","str",")",":","The","path","to","the","data","(",".bin",")","file","dtype","(","Type","[","numpy.number","]",",","optional",")",":","The","dtype","of","the","index","file",".","Defaults","to","numpy.int32",".","multimodal","(","bool",",","optional",")",":","Whether","the","dataset","is","multimodal",".","Defaults","to","False","."]
code: def __init__(
      self,
      bin_path: str,
      dtype: Type[numpy.number] = numpy.int32,
      multimodal: bool = False,
  ) -> None:
      self.data_file = open(bin_path, "wb")
      self.dtype = dtype
      self.multimodal = multimodal
  
      self.sequence_lengths = []
      self.document_indices = [0]
      self.sequence_modes = [] if self.multimodal else None
  
imports: import logging
  import os
  import shutil
  import struct
  import time
  from enum import Enum
  from functools import lru_cache
  from itertools import accumulate
  from types import TracebackType
  from typing import List, Optional, Tuple, Type, Union
  import numpy
  import torch
  from megatron.core.datasets.utils import log_single_rank
label_desc: Use image node_id 1 to create a new MMapIndexedDatasetBuilder object from inherited base classes: object with example: obj = MMapIndexedDatasetBuilder(bin_path, dtype, multimodal)