Skip to content

Commit 0e6c904

Browse files
committed
Fix Images
1 parent 66f97cf commit 0e6c904

File tree

1 file changed

+6
-6
lines changed
  • libs/community/langchain_community/document_loaders/parsers

1 file changed

+6
-6
lines changed

libs/community/langchain_community/document_loaders/parsers/images.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
import io
44
import logging
55
from abc import abstractmethod
6-
from typing import TYPE_CHECKING, Iterator, Literal
6+
from typing import TYPE_CHECKING, Iterable, Iterator, Literal
77

88
import numpy
99
import numpy as np
1010
from langchain_core.documents import Document
1111
from langchain_core.language_models import BaseChatModel
1212
from langchain_core.messages import HumanMessage
1313

14-
if TYPE_CHECKING:
15-
from PIL.Image import Image
16-
1714
from langchain_community.document_loaders.base import BaseBlobParser
1815
from langchain_community.document_loaders.blob_loaders import Blob
1916

17+
if TYPE_CHECKING:
18+
from PIL.Image import Image
19+
2020
logger = logging.getLogger(__name__)
2121

2222

@@ -167,7 +167,7 @@ def __init__(
167167
self,
168168
*,
169169
format: Literal["text", "markdown", "html"] = "text",
170-
langs: list[str] = ("eng",),
170+
langs: Iterable[str] = ("eng",),
171171
):
172172
"""
173173
Initializes the TesseractBlobParser.
@@ -179,7 +179,7 @@ def __init__(
179179
The languages to use for OCR.
180180
"""
181181
super().__init__(format=format)
182-
self.langs = langs
182+
self.langs = list(langs)
183183

184184
def _analyze_image(self, img: "Image") -> str:
185185
"""

0 commit comments

Comments
 (0)