From 04293466ade5d4c5bd408895624c0a92e723a948 Mon Sep 17 00:00:00 2001 From: GG <1592860538@qq.com> Date: Thu, 26 Dec 2024 22:03:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E4=BF=AE=E5=A4=8D=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=90=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 handle_cache 函数中添加了对 global_config 中 enable_l`lm_cache 设置的检查 - 如果配置禁用了缓存,则直接返回 None -这个修改确保了在不需要缓存的情况下,函数能够正确地跳过缓存处理 --- lightrag/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/utils.py b/lightrag/utils.py index bdb47592..722cf2bf 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -449,7 +449,7 @@ def dequantize_embedding( async def handle_cache(hashing_kv, args_hash, prompt, mode="default"): """Generic cache handling function""" - if hashing_kv is None: + if hashing_kv is None or not hashing_kv.global_config.get("enable_l`lm_cache"): return None, None, None, None # For naive mode, only use simple cache matching