Storage Interface¶
-
class
ffp.storage.
Storage
[source]¶ Common interface to finalfusion storage types.
-
abstract property
shape
¶ The storage shape
-
abstract classmethod
load
(file: BinaryIO, mmap=False) → ffp.storage.storage.Storage[source]¶ Load Storage from the given finalfusion file.
- Parameters
file (BinaryIO) – File at the beginning of a finalfusion storage
mmap (bool) – Toggles memory mapping the buffer.
- Returns
storage – The storage from the file.
- Return type
-
abstract static
mmap_storage
(file: BinaryIO) → ffp.storage.storage.Storage[source]¶ Memory map the storage.
Parallel method to
ffp.io.Chunk.read_chunk()
. Instead of storing theStorage
in-memory, it memory maps the embeddings.- Parameters
file (BinaryIO) – File at the beginning of a finalfusion storage
- Returns
storage – The memory mapped storage.
- Return type
-
abstract property