Skip to content

Commit

Permalink
Fix image-path validation in ImageNode (#17558)
Browse files Browse the repository at this point in the history
* fix image path validation

* Update llama-index-core/llama_index/core/schema.py

Co-authored-by: Massimiliano Pippi <[email protected]>

---------

Co-authored-by: Massimiliano Pippi <[email protected]>
  • Loading branch information
moria97 and masci authored Jan 20, 2025
1 parent eefa337 commit 637c79d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama-index-core/llama_index/core/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
kwargs["image_mimetype"] = ir.get("mimetype", None)

mimetype = kwargs.get("image_mimetype")
if not mimetype and "image_path" in kwargs:
if not mimetype and kwargs.get("image_path") is not None:
# guess mimetype from image_path
extension = Path(kwargs["image_path"]).suffix.replace(".", "")
if ftype := filetype.get_type(ext=extension):
Expand Down

0 comments on commit 637c79d

Please sign in to comment.