修复缓存处理的运行时错误

].func  # ["func"]
 ^^^^
AttributeError: 'dict' object has no attribute 'func'
This commit is contained in:
Magic_yuan
2025-01-24 11:01:32 +08:00
parent 443aab2882
commit f6d29e1793

View File

@@ -479,9 +479,7 @@ async def handle_cache(hashing_kv, args_hash, prompt, mode="default"):
quantized = min_val = max_val = None
if is_embedding_cache_enabled:
# Use embedding cache
embedding_model_func = hashing_kv.global_config[
"embedding_func"
].func # ["func"]
embedding_model_func = hashing_kv.global_config["embedding_func"]["func"]
llm_model_func = hashing_kv.global_config.get("llm_model_func")
current_embedding = await embedding_model_func([prompt])