修复logging的Bug

这个提交包含在:
binary-husky
2023-09-15 11:00:30 +08:00
父节点 16ff5ddcdc
当前提交 abea0d07ac
共有 2 个文件被更改,包括 2 次插入2 次删除

查看文件

@@ -715,7 +715,7 @@ class nougat_interface():
def nougat_with_timeout(self, command, cwd, timeout=3600): def nougat_with_timeout(self, command, cwd, timeout=3600):
import subprocess import subprocess
logging.info('正在执行命令', command) logging.info(f'正在执行命令 {command}')
process = subprocess.Popen(command, shell=True, cwd=cwd) process = subprocess.Popen(command, shell=True, cwd=cwd)
try: try:
stdout, stderr = process.communicate(timeout=timeout) stdout, stderr = process.communicate(timeout=timeout)

查看文件

@@ -205,7 +205,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
chunkjson = json.loads(chunk_decoded[6:]) chunkjson = json.loads(chunk_decoded[6:])
status_text = f"finish_reason: {chunkjson['choices'][0].get('finish_reason', 'null')}" status_text = f"finish_reason: {chunkjson['choices'][0].get('finish_reason', 'null')}"
# 如果这里抛出异常,一般是文本过长,详情见get_full_error的输出 # 如果这里抛出异常,一般是文本过长,详情见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 history[-1] = gpt_replying_buffer
chatbot[-1] = (history[-2], history[-1]) chatbot[-1] = (history[-2], history[-1])
yield from update_ui(chatbot=chatbot, history=history, msg=status_text) # 刷新界面 yield from update_ui(chatbot=chatbot, history=history, msg=status_text) # 刷新界面