Format code style in leann_multi_vector.py for better readability
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,9 @@ def _natural_sort_key(name: str) -> int:
|
||||
return int(m.group()) if m else 0
|
||||
|
||||
|
||||
def _load_images_from_dir(pages_dir: str, recursive: bool = False) -> tuple[list[str], list[Image.Image]]:
|
||||
def _load_images_from_dir(
|
||||
pages_dir: str, recursive: bool = False
|
||||
) -> tuple[list[str], list[Image.Image]]:
|
||||
"""
|
||||
Load images from a directory.
|
||||
|
||||
@@ -137,8 +139,8 @@ def _load_images_from_dir(pages_dir: str, recursive: bool = False) -> tuple[list
|
||||
try:
|
||||
img = Image.open(filepath)
|
||||
# Convert to RGB if necessary (handles RGBA, P, etc.)
|
||||
if img.mode != 'RGB':
|
||||
img = img.convert('RGB')
|
||||
if img.mode != "RGB":
|
||||
img = img.convert("RGB")
|
||||
images.append(img)
|
||||
valid_filepaths.append(filepath)
|
||||
except Exception as e:
|
||||
@@ -147,7 +149,9 @@ def _load_images_from_dir(pages_dir: str, recursive: bool = False) -> tuple[list
|
||||
continue
|
||||
|
||||
if failed_count > 0:
|
||||
print(f"Warning: Failed to load {failed_count} image(s) out of {len(filepaths)} total files")
|
||||
print(
|
||||
f"Warning: Failed to load {failed_count} image(s) out of {len(filepaths)} total files"
|
||||
)
|
||||
|
||||
return valid_filepaths, images
|
||||
|
||||
|
||||
Reference in New Issue
Block a user