From 7658f4cbf01aceca6d623ec9b71ff0c5f8223775 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 16 Jan 2025 01:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=80=A7=E8=83=BD=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=9A=84=E6=89=93=E5=8D=B0=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉非流式聊天中的性能统计打印 - 注释掉流式聊天中的性能统计打印 - 保持代码简洁,减少冗余输出 --- test_lightrag_ollama_chat.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test_lightrag_ollama_chat.py b/test_lightrag_ollama_chat.py index e0ed5342..069859f0 100644 --- a/test_lightrag_ollama_chat.py +++ b/test_lightrag_ollama_chat.py @@ -261,15 +261,15 @@ def test_non_stream_chat(): "message": response_json["message"] }, "响应内容") - # 打印性能统计 - print_json_response({ - "total_duration": response_json["total_duration"], - "load_duration": response_json["load_duration"], - "prompt_eval_count": response_json["prompt_eval_count"], - "prompt_eval_duration": response_json["prompt_eval_duration"], - "eval_count": response_json["eval_count"], - "eval_duration": response_json["eval_duration"] - }, "性能统计") + # # 打印性能统计 + # print_json_response({ + # "total_duration": response_json["total_duration"], + # "load_duration": response_json["load_duration"], + # "prompt_eval_count": response_json["prompt_eval_count"], + # "prompt_eval_duration": response_json["prompt_eval_duration"], + # "eval_count": response_json["eval_count"], + # "eval_duration": response_json["eval_duration"] + # }, "性能统计") def test_stream_chat(): """测试流式调用 /api/chat 接口 @@ -309,7 +309,7 @@ def test_stream_chat(): data = json.loads(line.decode('utf-8')) if data.get("done", True): # 如果是完成标记 if "total_duration" in data: # 最终的性能统计消息 - print_json_response(data, "性能统计") + # print_json_response(data, "性能统计") break else: # 正常的内容消息 message = data.get("message", {})