Skip to content

Commit

Permalink
update LanceDB integration (run-llama#16057)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushExel authored and raspawar committed Oct 7, 2024
1 parent ef6bf09 commit bcf5eae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,20 @@ def query(
else:
raise ValueError(f"Invalid query type: {query_type}")

lance_query = (
self._table.search(
if query_type == "hybrid":
lance_query = (
self._table.search(
vector_column_name=self.vector_column_name, query_type="hybrid"
)
.vector(query.query_embedding)
.text(query.query_str)
)
else:
lance_query = self._table.search(
query=_query,
vector_column_name=self.vector_column_name,
)
.limit(query.similarity_top_k * self.overfetch_factor)
.where(where)
)
lance_query.limit(query.similarity_top_k * self.overfetch_factor).where(where)

if query_type != "fts":
lance_query.nprobes(self.nprobes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version = "0.2.3"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
lancedb = ">=0.8.0,<0.13.0"
lancedb = ">=0.13.0"
tantivy = "*"
llama-index-core = "^0.11.0"

Expand Down

0 comments on commit bcf5eae

Please sign in to comment.