From abea0d07acc6190db530223376d66aaf3d0c8be1 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Fri, 15 Sep 2023 11:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlogging=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/crazy_utils.py | 2 +- request_llm/bridge_chatgpt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crazy_functions/crazy_utils.py b/crazy_functions/crazy_utils.py index bd2ee3f..ee1ab90 100644 --- a/crazy_functions/crazy_utils.py +++ b/crazy_functions/crazy_utils.py @@ -715,7 +715,7 @@ class nougat_interface(): def nougat_with_timeout(self, command, cwd, timeout=3600): import subprocess - logging.info('正在执行命令', command) + logging.info(f'正在执行命令 {command}') process = subprocess.Popen(command, shell=True, cwd=cwd) try: stdout, stderr = process.communicate(timeout=timeout) diff --git a/request_llm/bridge_chatgpt.py b/request_llm/bridge_chatgpt.py index 3fe854c..52290d6 100644 --- a/request_llm/bridge_chatgpt.py +++ b/request_llm/bridge_chatgpt.py @@ -205,7 +205,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp chunkjson = json.loads(chunk_decoded[6:]) status_text = f"finish_reason: {chunkjson['choices'][0].get('finish_reason', 'null')}" # 如果这里抛出异常,一般是文本过长,详情见get_full_error的输出 - gpt_replying_buffer = gpt_replying_buffer + json.loads(chunk_decoded[6:])['choices'][0]["delta"]["content"] + gpt_replying_buffer = gpt_replying_buffer + chunkjson['choices'][0]["delta"]["content"] history[-1] = gpt_replying_buffer chatbot[-1] = (history[-2], history[-1]) yield from update_ui(chatbot=chatbot, history=history, msg=status_text) # 刷新界面