Improve ocr loader error message

This commit is contained in:
trducng 2024-02-06 12:21:12 +07:00
parent 1a4fd7c33f
commit 7fc54d52e4

View File

@ -32,9 +32,10 @@ def read_pdf_unstructured(input_path: Union[Path, str]):
"""
try:
from unstructured.partition.auto import partition
except ImportError:
except ImportError as e:
raise ImportError(
"Please install unstructured PDF reader `pip install unstructured[pdf]`"
"Please install unstructured PDF reader `pip install unstructured[pdf]`: "
f"{e}"
)
page_items = defaultdict(list)