From 90c765c724c1ed4e68e3efd6c7e1b9eb2973e3b4 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 29 Jan 2025 22:14:18 +0800 Subject: [PATCH] Fix linting --- lightrag/kg/nano_vector_db_impl.py | 8 ++++++-- lightrag/operate.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lightrag/kg/nano_vector_db_impl.py b/lightrag/kg/nano_vector_db_impl.py index 54c1c824..e42036b5 100644 --- a/lightrag/kg/nano_vector_db_impl.py +++ b/lightrag/kg/nano_vector_db_impl.py @@ -87,7 +87,9 @@ class NanoVectorDBStorage(BaseVectorStorage): vector_db_kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {}) self.cosine_better_than_threshold = vector_db_kwargs.get( "cosine_better_than_threshold", - self.global_config.get("cosine_better_than_threshold", self.cosine_better_than_threshold) + self.global_config.get( + "cosine_better_than_threshold", self.cosine_better_than_threshold + ), ) async def upsert(self, data: dict[str, dict]): @@ -137,7 +139,9 @@ class NanoVectorDBStorage(BaseVectorStorage): async def query(self, query: str, top_k=5): embedding = await self.embedding_func([query]) embedding = embedding[0] - logger.info(f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}") + logger.info( + f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}" + ) results = self._client.query( query=embedding, top_k=top_k, diff --git a/lightrag/operate.py b/lightrag/operate.py index cf096993..aeb64a7e 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1028,7 +1028,7 @@ async def _build_query_context( # not necessary to use LLM to generate a response if not entities_context.strip() and not relations_context.strip(): return None - + return f""" -----Entities----- ```csv