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]):