Skip to content

Commit 53b0272

Browse files
authored
bugfix: set page_first_element_seg_start_flag default to True (#4231)
1 parent 8133136 commit 53b0272

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

paddlex/inference/pipelines/layout_parsing/result_v2.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ def _to_markdown(self, pretty=True) -> dict:
435435

436436
markdown_content = ""
437437
last_label = None
438-
seg_start_flag = None
439-
seg_end_flag = None
438+
seg_start_flag = True
439+
seg_end_flag = True
440440
prev_block = None
441441
page_first_element_seg_start_flag = None
442442
page_last_element_seg_end_flag = None
@@ -468,6 +468,11 @@ def _to_markdown(self, pretty=True) -> dict:
468468
else handle_func(block)
469469
)
470470
last_label = label
471+
page_first_element_seg_start_flag = (
472+
True
473+
if page_first_element_seg_start_flag is None
474+
else page_first_element_seg_start_flag
475+
)
471476
page_last_element_seg_end_flag = seg_end_flag
472477

473478
markdown_info["markdown_texts"] = markdown_content

0 commit comments

Comments
 (0)