yangdx commited on
Commit
94d231e
·
1 Parent(s): 493d8f0

Fix linting

Browse files
Files changed (2) hide show
  1. lightrag/lightrag.py +1 -1
  2. lightrag/utils.py +4 -2
lightrag/lightrag.py CHANGED
@@ -916,7 +916,7 @@ class LightRAG:
916
  else self.key_string_value_json_storage_cls(
917
  namespace="llm_response_cache",
918
  global_config=asdict(self),
919
- embedding_func=self.embedding_func,
920
  ),
921
  prompt=prompt,
922
  )
 
916
  else self.key_string_value_json_storage_cls(
917
  namespace="llm_response_cache",
918
  global_config=asdict(self),
919
+ embedding_func=self.embedding_func,
920
  ),
921
  prompt=prompt,
922
  )
lightrag/utils.py CHANGED
@@ -368,7 +368,9 @@ async def get_best_cached_response(
368
  original_prompt=None,
369
  cache_type=None,
370
  ) -> Union[str, None]:
371
- logger.debug(f"get_best_cached_response: mode={mode} cache_type={cache_type} use_llm_check={use_llm_check}")
 
 
372
  mode_cache = await hashing_kv.get_by_id(mode)
373
  if not mode_cache:
374
  return None
@@ -511,7 +513,7 @@ async def handle_cache(
511
  if is_embedding_cache_enabled:
512
  # Use embedding cache
513
  current_embedding = await hashing_kv.embedding_func([prompt])
514
- llm_model_func = hashing_kv.global_config.get('llm_model_func')
515
  quantized, min_val, max_val = quantize_embedding(current_embedding[0])
516
  best_cached_response = await get_best_cached_response(
517
  hashing_kv,
 
368
  original_prompt=None,
369
  cache_type=None,
370
  ) -> Union[str, None]:
371
+ logger.debug(
372
+ f"get_best_cached_response: mode={mode} cache_type={cache_type} use_llm_check={use_llm_check}"
373
+ )
374
  mode_cache = await hashing_kv.get_by_id(mode)
375
  if not mode_cache:
376
  return None
 
513
  if is_embedding_cache_enabled:
514
  # Use embedding cache
515
  current_embedding = await hashing_kv.embedding_func([prompt])
516
+ llm_model_func = hashing_kv.global_config.get("llm_model_func")
517
  quantized, min_val, max_val = quantize_embedding(current_embedding[0])
518
  best_cached_response = await get_best_cached_response(
519
  hashing_kv,