mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
Fix test_parser_with_table
This commit is contained in:
parent
29605cf0fc
commit
2a77d93a39
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user