Skip to content

Commit

Permalink
fix: FIx GraphRAG build error (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt authored Jul 9, 2024
1 parent bf978d2 commit 0d85c71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 7 additions & 2 deletions dbgpt/rag/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field, model_to_dict
from dbgpt.core import Chunk, Embeddings
from dbgpt.storage.vector_store.filters import MetadataFilters
from dbgpt.util.executor_utils import blocking_func_to_async
from dbgpt.util.executor_utils import (
blocking_func_to_async,
blocking_func_to_async_no_executor,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -195,4 +198,6 @@ async def asimilar_search_with_scores(
filters: Optional[MetadataFilters] = None,
) -> List[Chunk]:
"""Aynsc similar_search_with_score in vector database."""
return self.similar_search_with_scores(doc, topk, score_threshold, filters)
return await blocking_func_to_async_no_executor(
self.similar_search_with_scores, doc, topk, score_threshold, filters
)
8 changes: 2 additions & 6 deletions dbgpt/rag/retriever/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ async def _similarity_search_with_score(
"score_threshold": score_threshold,
},
):
return await blocking_func_to_async_no_executor(
self._index_store.similar_search_with_scores,
query,
self._top_k,
score_threshold,
filters,
return await self._index_store.asimilar_search_with_scores(
query, self._top_k, score_threshold, filters
)

0 comments on commit 0d85c71

Please sign in to comment.