Storage

ffp.storage

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

Load any storage from a finalfusion file.

ffp.storage.ndarray.load_ndarray(file[, mmap])

Load an array chunk from the given file.

ffp.storage.ndarray.NdArray(array)

Array storage.

ffp.storage.quantized.load_quantized_array(file)

Load a quantized array chunk from the given file.

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

QuantizedArray storage.

ffp.storage.quantized.PQ(quantizers, projection)

Product Quantizer

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

Load any storage from a finalfusion file.

Loads the first known storage from a finalfusion file.

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

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

Returns

vocab – First storage in the file.

Return type

Union[ffp.storage.NdArray, ffp.storage.QuantizedArray]

Raises

ValueError – If the file did not contain a storage.