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:
Erick Friis
2024-10-25 12:56:58 -07:00
committed by GitHub
parent 06df15c9c0
commit 600b7bdd61
237 changed files with 3668 additions and 4656 deletions

View File

@@ -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"