mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-04-22 11:47:47 +08:00
Fix: minor fix of refacotr excel parser use lazy image loader (#13752)
### What problem does this PR solve? Minor fix. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Hu Di <812791840@qq.com>
This commit is contained in:
@ -208,13 +208,17 @@ class VisionFigureParser:
|
||||
if len(item) == 2 and isinstance(item[0], tuple) and len(item[0]) == 2 and isinstance(item[1], list) and isinstance(item[1][0], tuple) and len(item[1][0]) == 5:
|
||||
img_desc = item[0]
|
||||
img = ensure_pil_image(img_desc[0])
|
||||
assert len(img_desc) == 2 and isinstance(img, Image.Image) and isinstance(img_desc[1], list), "Should be (figure, [description])"
|
||||
if img is None:
|
||||
continue
|
||||
assert len(img_desc) == 2 and isinstance(img_desc[1], list), "Should be (figure, [description])"
|
||||
self.figures.append(img)
|
||||
self.descriptions.append(img_desc[1])
|
||||
self.positions.append(item[1])
|
||||
else:
|
||||
img = ensure_pil_image(item[0])
|
||||
assert len(item) == 2 and isinstance(img, Image.Image) and isinstance(item[1], list), f"Unexpected form of figure data: get {len(item)=}, {item=}"
|
||||
if img is None:
|
||||
continue
|
||||
assert len(item) == 2 and isinstance(item[1], list), f"Unexpected form of figure data: get {len(item)=}, {item=}"
|
||||
self.figures.append(img)
|
||||
self.descriptions.append(item[1])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user