yangdx commited on
Commit
bd2684f
·
1 Parent(s): c62fd8f

Fix linting

Browse files
lightrag/kg/nano_vector_db_impl.py CHANGED
@@ -87,7 +87,9 @@ class NanoVectorDBStorage(BaseVectorStorage):
87
  vector_db_kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
88
  self.cosine_better_than_threshold = vector_db_kwargs.get(
89
  "cosine_better_than_threshold",
90
- self.global_config.get("cosine_better_than_threshold", self.cosine_better_than_threshold)
 
 
91
  )
92
 
93
  async def upsert(self, data: dict[str, dict]):
@@ -137,7 +139,9 @@ class NanoVectorDBStorage(BaseVectorStorage):
137
  async def query(self, query: str, top_k=5):
138
  embedding = await self.embedding_func([query])
139
  embedding = embedding[0]
140
- logger.info(f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}")
 
 
141
  results = self._client.query(
142
  query=embedding,
143
  top_k=top_k,
 
87
  vector_db_kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
88
  self.cosine_better_than_threshold = vector_db_kwargs.get(
89
  "cosine_better_than_threshold",
90
+ self.global_config.get(
91
+ "cosine_better_than_threshold", self.cosine_better_than_threshold
92
+ ),
93
  )
94
 
95
  async def upsert(self, data: dict[str, dict]):
 
139
  async def query(self, query: str, top_k=5):
140
  embedding = await self.embedding_func([query])
141
  embedding = embedding[0]
142
+ logger.info(
143
+ f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}"
144
+ )
145
  results = self._client.query(
146
  query=embedding,
147
  top_k=top_k,
lightrag/operate.py CHANGED
@@ -1028,7 +1028,7 @@ async def _build_query_context(
1028
  # not necessary to use LLM to generate a response
1029
  if not entities_context.strip() and not relations_context.strip():
1030
  return None
1031
-
1032
  return f"""
1033
  -----Entities-----
1034
  ```csv
 
1028
  # not necessary to use LLM to generate a response
1029
  if not entities_context.strip() and not relations_context.strip():
1030
  return None
1031
+
1032
  return f"""
1033
  -----Entities-----
1034
  ```csv