From bd60b2a11a4818c05d7adb6d2243d5adad0cd76d Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 10 May 2025 18:15:23 +0800 Subject: [PATCH] . --- scripts/rag_build_query.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/scripts/rag_build_query.py b/scripts/rag_build_query.py index 4ade395..c7b539d 100644 --- a/scripts/rag_build_query.py +++ b/scripts/rag_build_query.py @@ -189,28 +189,6 @@ def build_user_index(user_id: str): # 确认存储是否加载成功,检查索引数据 logger.info("已成功加载存储上下文。") - # 禁用 LLM 并确保从存储加载时不涉及 OpenAI 模型 - # 使用本地模型或 Mock 模型(不涉及 OpenAI) - service_context = ServiceContext.from_defaults( - embed_model='local', # 使用本地嵌入模型 - llm=None # 确保禁用 LLM - ) - - # 使用 load_index_from_storage 加载索引,确保不触发 OpenAI 加载 - try: - loaded_index = load_index_from_storage(storage_context) - - # 检查加载后的索引 - logger.info(f"加载的索引数量: {len(loaded_index.get_documents())}") - except Exception as e: - logger.error(f"加载索引时发生错误: {e}") - raise HTTPException(status_code=500, detail="索引加载失败") - - - - - - except Exception as e: