yangdx commited on
Commit
2b61630
·
1 Parent(s): 835a76d

移除性能统计的打印输出

Browse files

- 注释掉非流式聊天中的性能统计打印
- 注释掉流式聊天中的性能统计打印
- 保持代码简洁,减少冗余输出

Files changed (1) hide show
  1. test_lightrag_ollama_chat.py +10 -10
test_lightrag_ollama_chat.py CHANGED
@@ -261,15 +261,15 @@ def test_non_stream_chat():
261
  "message": response_json["message"]
262
  }, "响应内容")
263
 
264
- # 打印性能统计
265
- print_json_response({
266
- "total_duration": response_json["total_duration"],
267
- "load_duration": response_json["load_duration"],
268
- "prompt_eval_count": response_json["prompt_eval_count"],
269
- "prompt_eval_duration": response_json["prompt_eval_duration"],
270
- "eval_count": response_json["eval_count"],
271
- "eval_duration": response_json["eval_duration"]
272
- }, "性能统计")
273
 
274
  def test_stream_chat():
275
  """测试流式调用 /api/chat 接口
@@ -309,7 +309,7 @@ def test_stream_chat():
309
  data = json.loads(line.decode('utf-8'))
310
  if data.get("done", True): # 如果是完成标记
311
  if "total_duration" in data: # 最终的性能统计消息
312
- print_json_response(data, "性能统计")
313
  break
314
  else: # 正常的内容消息
315
  message = data.get("message", {})
 
261
  "message": response_json["message"]
262
  }, "响应内容")
263
 
264
+ # # 打印性能统计
265
+ # print_json_response({
266
+ # "total_duration": response_json["total_duration"],
267
+ # "load_duration": response_json["load_duration"],
268
+ # "prompt_eval_count": response_json["prompt_eval_count"],
269
+ # "prompt_eval_duration": response_json["prompt_eval_duration"],
270
+ # "eval_count": response_json["eval_count"],
271
+ # "eval_duration": response_json["eval_duration"]
272
+ # }, "性能统计")
273
 
274
  def test_stream_chat():
275
  """测试流式调用 /api/chat 接口
 
309
  data = json.loads(line.decode('utf-8'))
310
  if data.get("done", True): # 如果是完成标记
311
  if "total_duration" in data: # 最终的性能统计消息
312
+ # print_json_response(data, "性能统计")
313
  break
314
  else: # 正常的内容消息
315
  message = data.get("message", {})