mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 12:48:28 +00:00
fix: add page as argument to build_prompt
Signed-off-by: ElHachem02 <peterelhachem02@gmail.com>
This commit is contained in:
@@ -86,6 +86,7 @@ class ThreadedLayoutVlmPipeline(BasePipeline):
|
|||||||
class LayoutAwareVlmOptions(type(base_vlm_options)): # type: ignore[misc]
|
class LayoutAwareVlmOptions(type(base_vlm_options)): # type: ignore[misc]
|
||||||
def build_prompt(
|
def build_prompt(
|
||||||
self,
|
self,
|
||||||
|
page: Optional[SegmentedPage],
|
||||||
*,
|
*,
|
||||||
_internal_page: Optional[Page] = None,
|
_internal_page: Optional[Page] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
@@ -120,6 +121,9 @@ class ThreadedLayoutVlmPipeline(BasePipeline):
|
|||||||
print("Found a table!")
|
print("Found a table!")
|
||||||
tag_name = "otsl"
|
tag_name = "otsl"
|
||||||
|
|
||||||
|
if tag_name == "section_header_level_1":
|
||||||
|
tag_name = "section_header"
|
||||||
|
|
||||||
# Convert bbox to tuple and get location tokens
|
# Convert bbox to tuple and get location tokens
|
||||||
bbox_tuple = cluster.bbox.as_tuple()
|
bbox_tuple = cluster.bbox.as_tuple()
|
||||||
location_tokens = DocumentToken.get_location(
|
location_tokens = DocumentToken.get_location(
|
||||||
|
|||||||
Reference in New Issue
Block a user