From 2a77d93a39361ce5b7ee076daa8e6c0f1d18937a Mon Sep 17 00:00:00 2001 From: Philippe Prados Date: Thu, 27 Feb 2025 11:04:34 +0100 Subject: [PATCH] Fix test_parser_with_table --- .../langchain_community/document_loaders/parsers/pdf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/parsers/pdf.py b/libs/community/langchain_community/document_loaders/parsers/pdf.py index e198d22752c..83ff2bf3a19 100644 --- a/libs/community/langchain_community/document_loaders/parsers/pdf.py +++ b/libs/community/langchain_community/document_loaders/parsers/pdf.py @@ -1557,11 +1557,13 @@ class PDFPlumberParser(BaseBlobParser): if self.images_parser: try: from PIL import Image as Img - Img.fromarray(content) # Check if image is valid + + Img.fromarray(content) # Check if image is valid image_bytes = io.BytesIO() numpy.save(image_bytes, content) blob = Blob.from_data( - image_bytes.getvalue(), mime_type="application/x-npy" + image_bytes.getvalue(), + mime_type="application/x-npy", ) text_from_image = next( self.images_parser.lazy_parse(blob) # type: ignore