浏览代码

Show the errors out. (#4305)

### What problem does this PR solve?


### Type of change

- [x] Refactoring
tags/v0.16.0
Kevin Hu 10 个月前
父节点
当前提交
0e5124ec99
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 3
    0
      rag/raptor.py
  2. 2
    2
      rag/svr/task_executor.py

+ 3
- 0
rag/raptor.py 查看文件

@@ -127,6 +127,9 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval:
ck_idx = [i + start for i in range(len(lbls)) if lbls[i] == c]
threads.append(executor.submit(summarize, ck_idx, lock))
wait(threads, return_when=ALL_COMPLETED)
for th in threads:
if isinstance(th.result(), Exception):
raise th.result()
logging.debug(str([t.result() for t in threads]))

assert len(chunks) - end == n_clusters, "{} vs. {}".format(len(chunks) - end, n_clusters)

+ 2
- 2
rag/svr/task_executor.py 查看文件

@@ -526,12 +526,12 @@ def handle_task():
except Exception:
pass
logging.debug("handle_task got TaskCanceledException", exc_info=True)
except Exception:
except Exception as e:
with mt_lock:
FAILED_TASKS += 1
CURRENT_TASK = None
try:
set_progress(task["id"], prog=-1, msg="handle_task got exception, please check log")
set_progress(task["id"], prog=-1, msg=f"[Exception]: {e}")
except Exception:
pass
logging.exception(f"handle_task got exception for task {json.dumps(task)}")

正在加载...
取消
保存