core.datasets.retro.index.factory#
The IndexFactory constructs an index from an index type string.
Module Contents#
Classes#
Get index. |
API#
- class core.datasets.retro.index.factory.IndexFactory#
Get index.
Index type generally read from argument ‘–retro-index-ty’.
- classmethod get_index_class(index_type: str) type#
Get an index class, given a type string.
- Parameters:
index_type (str) – One of ‘faiss-base’ (naive Faiss index wrapper) or ‘faiss-par-add’ (Faiss index wrapper with near embarrassingly parallel index.add().
- Returns:
An
Indexsub-type corresponding to theindex_type.
- classmethod get_index(
- index_type: str,
Construct an index from an index type string.
- Parameters:
index_type (str) – One of ‘faiss-base’ (naive Faiss index wrapper) or ‘faiss-par-add’ (Faiss index wrapper with near embarrassingly parallel index.add().
- Returns:
An
Indexinstance corresponding to theindex_type.