jinhai-2012 commited on
Commit
d3e6ea3
·
1 Parent(s): 184de31

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

Browse files

### What problem does this PR solve?

Specific error message.

### Type of change

- [x] Refactoring

Signed-off-by: jinhai <[email protected]>

Files changed (1) hide show
  1. rag/svr/task_executor.py +7 -0
rag/svr/task_executor.py CHANGED
@@ -448,6 +448,13 @@ def do_handle_task(task):
448
  # prepare the progress callback function
449
  progress_callback = partial(set_progress, task_id, task_from_page, task_to_page)
450
 
 
 
 
 
 
 
 
451
  try:
452
  task_canceled = TaskService.do_cancel(task_id)
453
  except DoesNotExist:
 
448
  # prepare the progress callback function
449
  progress_callback = partial(set_progress, task_id, task_from_page, task_to_page)
450
 
451
+ # FIXME: workaround, Infinity doesn't support table parsing method, this check is to notify user
452
+ lower_case_doc_engine = settings.DOC_ENGINE.lower()
453
+ if lower_case_doc_engine == 'infinity' and task['parser_id'].lower() == 'table':
454
+ error_message = "Table parsing method is not supported by Infinity, please use other parsing methods or use Elasticsearch as the document engine."
455
+ progress_callback(-1, msg=error_message)
456
+ raise Exception(error_message)
457
+
458
  try:
459
  task_canceled = TaskService.do_cancel(task_id)
460
  except DoesNotExist: