Storage

finalfusion.storage

finalfusion.storage.load_storage(file[, mmap])

Load any vocabulary from a finalfusion file.

finalfusion.storage.ndarray.load_ndarray(file)

Load an array chunk from the given file.

finalfusion.storage.ndarray.NdArray(array)

Array storage.

finalfusion.storage.quantized.load_quantized_array(file)

Load a quantized array chunk from the given file.

finalfusion.storage.quantized.QuantizedArray(pq, …)

QuantizedArray storage.

finalfusion.storage.load_storage(file: Union[str, bytes, int, os.PathLike], mmap: bool = False)finalfusion.storage.storage.Storage[source]

Load any vocabulary from a finalfusion file.

Loads the first known vocabulary from a finalfusion file.

Parameters
  • file (str) – Path to finalfusion file containing a storage chunk.

  • mmap (bool) – Toggles memory mapping the storage buffer as read-only.

Returns

storage – First finalfusion Storage in the file.

Return type

Storage

Raises

ValueError – If the file did not contain a vocabulary.