mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 20:46:45 +00:00
all: test 3.13 ci (#27197)
Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
@@ -76,13 +76,13 @@ class ImageCaptionLoader(BaseLoader):
|
||||
|
||||
try:
|
||||
if isinstance(image, bytes):
|
||||
image = Image.open(BytesIO(image)).convert("RGB")
|
||||
image = Image.open(BytesIO(image)).convert("RGB") # type: ignore[assignment]
|
||||
elif isinstance(image, str) and (
|
||||
image.startswith("http://") or image.startswith("https://")
|
||||
):
|
||||
image = Image.open(requests.get(image, stream=True).raw).convert("RGB")
|
||||
image = Image.open(requests.get(image, stream=True).raw).convert("RGB") # type: ignore[assignment, arg-type]
|
||||
else:
|
||||
image = Image.open(image).convert("RGB")
|
||||
image = Image.open(image).convert("RGB") # type: ignore[assignment]
|
||||
except Exception:
|
||||
if isinstance(image_source, bytes):
|
||||
msg = "Could not get image data from bytes"
|
||||
|
Reference in New Issue
Block a user