From b052519a5e0b4ce16bbef1a973216365c2283645 Mon Sep 17 00:00:00 2001 From: KevinHuSh Date: Mon, 22 Apr 2024 15:13:01 +0800 Subject: [PATCH] fix ollama issuet push (#486) ### What problem does this PR solve? #477 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/chat_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 7452931ce0..d4a45f00ac 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