mirror of
https://github.com/azaion/gps-denied-desktop.git
synced 2026-04-22 22:46:36 +00:00
abc26d5c20
docs -> _docs
35 lines
954 B
Python
35 lines
954 B
Python
from typing import Optional
|
|
import numpy as np
|
|
|
|
|
|
class FaissIndexManager:
|
|
def __init__(self, dimension: int, index_type: str = "IVF"):
|
|
self._dimension = dimension
|
|
self._index_type = index_type
|
|
self._index = None
|
|
self._id_map: dict[int, str] = {}
|
|
|
|
def build_index(self, vectors: np.ndarray, ids: list[str]) -> bool:
|
|
raise NotImplementedError
|
|
|
|
def add_vectors(self, vectors: np.ndarray, ids: list[str]) -> bool:
|
|
raise NotImplementedError
|
|
|
|
def search(
|
|
self, query: np.ndarray, top_k: int = 10
|
|
) -> list[tuple[str, float]]:
|
|
raise NotImplementedError
|
|
|
|
def remove_vectors(self, ids: list[str]) -> bool:
|
|
raise NotImplementedError
|
|
|
|
def save_index(self, path: str) -> bool:
|
|
raise NotImplementedError
|
|
|
|
def load_index(self, path: str) -> bool:
|
|
raise NotImplementedError
|
|
|
|
def get_vector_count(self) -> int:
|
|
raise NotImplementedError
|
|
|