mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 07:35:18 +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:
|
if self.images_parser:
|
||||||
try:
|
try:
|
||||||
from PIL import Image as Img
|
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()
|
image_bytes = io.BytesIO()
|
||||||
numpy.save(image_bytes, content)
|
numpy.save(image_bytes, content)
|
||||||
blob = Blob.from_data(
|
blob = Blob.from_data(
|
||||||
image_bytes.getvalue(), mime_type="application/x-npy"
|
image_bytes.getvalue(),
|
||||||
|
mime_type="application/x-npy",
|
||||||
)
|
)
|
||||||
text_from_image = next(
|
text_from_image = next(
|
||||||
self.images_parser.lazy_parse(blob) # type: ignore
|
self.images_parser.lazy_parse(blob) # type: ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user