From c4638bfde39f6e4fa6c4e6f6cea62fa75c03e258 Mon Sep 17 00:00:00 2001 From: xuyuan23 <643854343@qq.com> Date: Thu, 27 Jul 2023 11:11:59 +0800 Subject: [PATCH] fix: fix function bard_generate_stream's output fix function bard_generate_stream's output --- pilot/model/proxy/proxy_llms/bard.py | 5 ++--- pilot/model/proxy/security/sens_data_recognition.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pilot/model/proxy/proxy_llms/bard.py b/pilot/model/proxy/proxy_llms/bard.py index dcdb291d9..770a1ec6a 100644 --- a/pilot/model/proxy/proxy_llms/bard.py +++ b/pilot/model/proxy/proxy_llms/bard.py @@ -34,6 +34,5 @@ def bard_generate_stream(model, tokenizer, params, device, context_len=2048): response = bardapi.core.Bard(token).get_answer(last_user_input["content"]) if response is not None and response.get("content") is not None: yield str(response["content"]) - yield f"bard response error: {str(response)}" - - + else: + yield f"bard response error: {str(response)}" diff --git a/pilot/model/proxy/security/sens_data_recognition.py b/pilot/model/proxy/security/sens_data_recognition.py index a0e83cd8e..62a2978a9 100644 --- a/pilot/model/proxy/security/sens_data_recognition.py +++ b/pilot/model/proxy/security/sens_data_recognition.py @@ -1,3 +1,3 @@ """ a tool to discovery sensitive data -""" \ No newline at end of file +"""