mlx.data.Stream.line_reader_from_key

mlx.data.Stream.line_reader_from_key#

Stream.line_reader_from_key(self: mlx.data._c.Stream, key: str, dst_key: str, from_memory: bool = False, unzip: bool = False, local_prefix: os.PathLike = '', file_fetcher: mlx::data::core::FileFetcher = None) mlx.data._c.Stream#

Read the file pointed to from the array at key and yield the lines as separate samples in the stream in the dst_key.

This operation is similar to stream_line_reader() but applied once for every sample in the stream and the samples from the resulting stream are returned until exhaustion.

Parameters:
  • key (str) – The sample key that contains the array we are operating on.

  • dst_key (str) – The key to put the lines into.

  • from_memory (bool) – Read the lines from the contents of the array rather than treating the array as a filename. (default: False)

  • unzip (bool) – Treat the file or memory stream as a compressed stream and decompress it on the fly. (default: false)

  • local_prefix (str) – The filepath prefix to use to read the files. (default: ‘’)

  • file_fetcher (mlx.data.core.FileFetcher, optional) – A file fetcher to read the text files possibly from a remote location.