浏览代码

Error message: Infinity not support table parsing method (#4439)

### What problem does this PR solve?

Specific error message.

### Type of change

- [x] Refactoring

Signed-off-by: jinhai <haijin.chn@gmail.com>
tags/v0.16.0
Jin Hai 9 个月前
父节点
当前提交
4dde73f897
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      rag/svr/task_executor.py

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

@@ -448,6 +448,13 @@ def do_handle_task(task):
# prepare the progress callback function
progress_callback = partial(set_progress, task_id, task_from_page, task_to_page)

# FIXME: workaround, Infinity doesn't support table parsing method, this check is to notify user
lower_case_doc_engine = settings.DOC_ENGINE.lower()
if lower_case_doc_engine == 'infinity' and task['parser_id'].lower() == 'table':
error_message = "Table parsing method is not supported by Infinity, please use other parsing methods or use Elasticsearch as the document engine."
progress_callback(-1, msg=error_message)
raise Exception(error_message)

try:
task_canceled = TaskService.do_cancel(task_id)
except DoesNotExist:

正在加载...
取消
保存