fix: add page as argument to build_prompt

Signed-off-by: ElHachem02 <peterelhachem02@gmail.com>
This commit is contained in:
ElHachem02
2025-12-04 13:36:20 +01:00
parent 0904dbb95a
commit 3df3cf8664

View File

@@ -86,6 +86,7 @@ class ThreadedLayoutVlmPipeline(BasePipeline):
class LayoutAwareVlmOptions(type(base_vlm_options)): # type: ignore[misc]
def build_prompt(
self,
page: Optional[SegmentedPage],
*,
_internal_page: Optional[Page] = None,
) -> str:
@@ -120,6 +121,9 @@ class ThreadedLayoutVlmPipeline(BasePipeline):
print("Found a table!")
tag_name = "otsl"
if tag_name == "section_header_level_1":
tag_name = "section_header"
# Convert bbox to tuple and get location tokens
bbox_tuple = cluster.bbox.as_tuple()
location_tokens = DocumentToken.get_location(