From 72974d5ce6a16f86a85c6fd6480a4351b95db62a Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Tue, 9 Dec 2025 18:53:41 +0800 Subject: [PATCH] Update chat_model.py --- rag/llm/chat_model.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 9e98b07c9..648bbe8ce 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -191,8 +191,9 @@ class Base(ABC): except Exception as e: e = await self._exceptions_async(e, attempt) if e: - yield e - yield total_tokens + yield e + yield total_tokens + return def _length_stop(self, ans): if is_chinese([ans]):