mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 00:36:02 +08:00
Fix: Sometimes VisionFigureParser.figures may is tuple (#7477)
### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/7466 I think due to some times we can not get position ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c98933499a
commit
953b3e1b3f
@ -51,8 +51,13 @@ class VisionFigureParser:
|
||||
self.positions.append(item[1])
|
||||
else:
|
||||
assert len(item) == 2 and isinstance(item, tuple) and isinstance(item[1], list), f"get {len(item)=}, {item=}"
|
||||
self.figures.append(item[0])
|
||||
self.descriptions.append(item[1])
|
||||
if isinstance(item[0], tuple) and len(item[0]) == 2 and isinstance(item[0][0], Image.Image) and isinstance(item[0][1], list):
|
||||
self.figures.append(item[0][0])
|
||||
self.descriptions.append(item[0][1])
|
||||
else:
|
||||
self.figures.append(item[0])
|
||||
self.descriptions.append(item[1])
|
||||
|
||||
|
||||
def _assemble(self):
|
||||
self.assembled = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user