From 67f41559a8ce7c614d1088f1a361e74e405e29fb Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Tue, 31 Oct 2023 19:33:58 +0800 Subject: [PATCH] feat:mapreduce summary --- pilot/server/knowledge/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pilot/server/knowledge/service.py b/pilot/server/knowledge/service.py index d7fb476d7..0b6e260dc 100644 --- a/pilot/server/knowledge/service.py +++ b/pilot/server/knowledge/service.py @@ -578,10 +578,12 @@ class KnowledgeService: from pilot.common.chat_util import llm_chat_response_nostream import uuid tasks = [] + max_iteration = 5 if len(docs) == 1: summary = self._llm_extract_summary(doc=docs[0]) return summary else: + max_iteration = max_iteration if len(docs) > max_iteration else len(docs) for doc in docs: chat_param = { "chat_session_id": uuid.uuid1(),