瀏覽代碼

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)
tags/v0.19.0
Stephen Hu 6 月之前
父節點
當前提交
953b3e1b3f
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 7 行新增2 行删除
  1. 7
    2
      deepdoc/parser/figure_parser.py

+ 7
- 2
deepdoc/parser/figure_parser.py 查看文件

@@ -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…
取消
儲存