Skip to content

Commit

Permalink
chore: relock dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lsorber committed Dec 15, 2024
1 parent d654872 commit 7b05cb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions src/raglite/_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,9 @@ def create_database_engine(config: RAGLiteConfig | None = None) -> Engine:
with Session(engine) as session:
metrics = {"cosine": "cosine", "dot": "ip", "euclidean": "l2", "l1": "l1", "l2": "l2"}
session.execute(
text(
"""
CREATE INDEX IF NOT EXISTS keyword_search_chunk_index ON chunk USING GIN (to_tsvector('simple', body));
"""
)
text("""
CREATE INDEX IF NOT EXISTS keyword_search_chunk_index ON chunk USING GIN (to_tsvector('simple', body));
""")
)
create_vector_index_sql = f"""
CREATE INDEX IF NOT EXISTS vector_search_chunk_index ON chunk_embedding
Expand All @@ -382,7 +380,7 @@ def create_database_engine(config: RAGLiteConfig | None = None) -> Engine:
);
SET hnsw.ef_search = {20 * 4 * 8};
"""
# Add iterative scan if version >= 0.8.0
# Enable iterative scan for pgvector v0.8.0 and up.
pgvector_version = _pgvector_version(session)
if pgvector_version and pgvector_version >= version.parse("0.8.0"):
create_vector_index_sql += f"\nSET hnsw.iterative_scan = {'relaxed_order' if config.reranker else 'strict_order'};"
Expand Down

0 comments on commit 7b05cb0

Please sign in to comment.