diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 58d5b0ded6..1dbf509351 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -67,6 +67,7 @@ def chat_streamly(self, system, history, gen_conf): if not resp.choices[0].delta.content: resp.choices[0].delta.content = "" ans += resp.choices[0].delta.content + total_tokens += 1 if not hasattr(resp, "usage") or not resp.usage: total_tokens = (