GgWith commited on
Commit
b74f71b
·
1 Parent(s): e32751d

fix(utils): 修复缓存未正确启用的问题

Browse files

- 在 handle_cache 函数中添加了对 global_config 中 enable_l`lm_cache 设置的检查
- 如果配置禁用了缓存,则直接返回 None
-这个修改确保了在不需要缓存的情况下,函数能够正确地跳过缓存处理

Files changed (1) hide show
  1. lightrag/utils.py +1 -1
lightrag/utils.py CHANGED
@@ -449,7 +449,7 @@ def dequantize_embedding(
449
 
450
  async def handle_cache(hashing_kv, args_hash, prompt, mode="default"):
451
  """Generic cache handling function"""
452
- if hashing_kv is None:
453
  return None, None, None, None
454
 
455
  # For naive mode, only use simple cache matching
 
449
 
450
  async def handle_cache(hashing_kv, args_hash, prompt, mode="default"):
451
  """Generic cache handling function"""
452
+ if hashing_kv is None or not hashing_kv.global_config.get("enable_l`lm_cache"):
453
  return None, None, None, None
454
 
455
  # For naive mode, only use simple cache matching