Skip to content

Class swarmauri_core.vector_stores.IVectorStoreSaveLoad.IVectorStoreSaveLoad

swarmauri_core.vector_stores.IVectorStoreSaveLoad.IVectorStoreSaveLoad

Bases: ABC

Interface to abstract the ability to save and load the state of a vector store. This includes saving/loading the vectorizer's model as well as the documents or vectors.

save_store abstractmethod

save_store(directory_path)

Saves the state of the vector store to the specified directory. This includes both the vectorizer's model and the stored documents or vectors.

Parameters: - directory_path (str): The directory path where the store's state will be saved.

Source code in swarmauri_core/vector_stores/IVectorStoreSaveLoad.py
10
11
12
13
14
15
16
17
18
19
@abstractmethod
def save_store(self, directory_path: str) -> None:
    """
    Saves the state of the vector store to the specified directory. This includes
    both the vectorizer's model and the stored documents or vectors.

    Parameters:
    - directory_path (str): The directory path where the store's state will be saved.
    """
    pass

load_store abstractmethod

load_store(directory_path)

Loads the state of the vector store from the specified directory. This includes both the vectorizer's model and the stored documents or vectors.

Parameters: - directory_path (str): The directory path from where the store's state will be loaded.

Source code in swarmauri_core/vector_stores/IVectorStoreSaveLoad.py
21
22
23
24
25
26
27
28
29
30
@abstractmethod
def load_store(self, directory_path: str) -> None:
    """
    Loads the state of the vector store from the specified directory. This includes
    both the vectorizer's model and the stored documents or vectors.

    Parameters:
    - directory_path (str): The directory path from where the store's state will be loaded.
    """
    pass

save_parts abstractmethod

save_parts(directory_path, chunk_size=10485760)

Save the model in parts to handle large files by splitting them.

Source code in swarmauri_core/vector_stores/IVectorStoreSaveLoad.py
32
33
34
35
36
37
38
@abstractmethod
def save_parts(self, directory_path: str, chunk_size: int = 10485760) -> None:
    """
    Save the model in parts to handle large files by splitting them.

    """
    pass

load_parts abstractmethod

load_parts(directory_path, file_pattern)

Load and combine model parts from a directory.

Source code in swarmauri_core/vector_stores/IVectorStoreSaveLoad.py
40
41
42
43
44
45
46
@abstractmethod
def load_parts(self, directory_path: str, file_pattern: str) -> None:
    """
    Load and combine model parts from a directory.

    """
    pass