diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 7452931ce03..d4a45f00ac7 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -153,7 +153,7 @@ def chat(self, system, history, gen_conf): options=options ) ans = response["message"]["content"].strip() - return ans, response["eval_count"] + response["prompt_eval_count"] + return ans, response["eval_count"] + response.get("prompt_eval_count", 0) except Exception as e: return "**ERROR**: " + str(e), 0