ludwig-ai--ludwig
593b94c120
pytest / Unit Tests (push) Has been cancelled
pytest / Integration (integration_tests_a) (push) Has been cancelled
pytest / Integration (integration_tests_b) (push) Has been cancelled
pytest / Integration (integration_tests_c) (push) Has been cancelled
pytest / Integration (integration_tests_d) (push) Has been cancelled
pytest / Integration (integration_tests_e) (push) Has been cancelled
pytest / Integration (integration_tests_f) (push) Has been cancelled
pytest / Integration (integration_tests_g) (push) Has been cancelled
pytest / Integration (integration_tests_h) (push) Has been cancelled
pytest / Integration (integration_tests_i) (push) Has been cancelled
pytest / Integration (integration_tests_j) (push) Has been cancelled
pytest / Distributed (distributed_a) (push) Has been cancelled
pytest / Distributed (distributed_b) (push) Has been cancelled
pytest / Distributed (distributed_c) (push) Has been cancelled
pytest / Distributed (distributed_d) (push) Has been cancelled
pytest / Distributed (distributed_e) (push) Has been cancelled
pytest / Distributed (distributed_f) (push) Has been cancelled
pytest / Minimal Install (push) Has been cancelled
pytest / Event File (push) Has been cancelled
pytest (slow) / py-slow (push) Has been cancelled
Publish JSON Schema / publish-schema (push) Has been cancelled
29 行
541 B
Python
29 行
541 B
Python
import logging
|
|
|
|
from ludwig.api_annotations import DeveloperAPI
|
|
from ludwig.vector_index.base import VectorIndex
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
FAISS = "faiss"
|
|
|
|
ALL_INDICES = [FAISS]
|
|
|
|
|
|
def get_faiss_index_cls() -> type[VectorIndex]:
|
|
from ludwig.vector_index.faiss import FaissIndex
|
|
|
|
return FaissIndex
|
|
|
|
|
|
# TODO(travis): add other indexing structures
|
|
vector_index_registry = {
|
|
FAISS: get_faiss_index_cls,
|
|
}
|
|
|
|
|
|
@DeveloperAPI
|
|
def get_vector_index_cls(type: str) -> type[VectorIndex]:
|
|
return vector_index_registry[type]()
|