2023-10-16 09:31:10 +00:00
|
|
|
"""
|
|
|
|
Tests regarding the vector store class, including checking
|
|
|
|
compatibility between different transformers and local vector
|
|
|
|
stores (index.faiss)
|
|
|
|
"""
|
2023-10-15 08:22:07 +00:00
|
|
|
import pytest
|
|
|
|
from application.vectorstore.faiss import FaissStore
|
|
|
|
from application.core.settings import settings
|
|
|
|
|
|
|
|
def test_init_local_faiss_store_huggingface():
|
|
|
|
"""
|
|
|
|
Test that asserts that trying to initialize a FaissStore with
|
|
|
|
the huggingface sentence transformer below together with the
|
|
|
|
index.faiss file in the application/ folder results in a
|
|
|
|
dimension mismatch error.
|
|
|
|
"""
|
2024-01-09 00:34:04 +00:00
|
|
|
settings.EMBEDDINGS_NAME = "openai_text-embedding-ada-002"
|
2023-10-15 08:22:07 +00:00
|
|
|
with pytest.raises(ValueError):
|
|
|
|
FaissStore("application/", "", None)
|