镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 14:36:48 +00:00
better traceback
这个提交包含在:
@@ -1,18 +1,7 @@
|
||||
from functools import wraps
|
||||
from predict import predict_no_ui
|
||||
from toolbox import CatchException, report_execption
|
||||
fast_debug = False
|
||||
|
||||
def CatchException(f):
|
||||
@wraps(f)
|
||||
def decorated(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT):
|
||||
try:
|
||||
yield from f(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
tb_str = traceback.format_exc()
|
||||
chatbot[-1] = (chatbot[-1][0], f"[Local Message] something error occured: \n {tb_str}")
|
||||
yield chatbot, history, f'异常 {e}'
|
||||
return decorated
|
||||
|
||||
|
||||
@CatchException
|
||||
@@ -66,12 +55,6 @@ def 解析项目本身(txt, top_p, temperature, chatbot, history, systemPromptTx
|
||||
history.append(i_say); history.append(gpt_say)
|
||||
yield chatbot, history, '正常'
|
||||
|
||||
def report_execption(chatbot, history, a, b):
|
||||
chatbot.append((a, b))
|
||||
history.append(a); history.append(b)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def 解析源代码(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt):
|
||||
|
||||
在新工单中引用
屏蔽一个用户