Skip to content

Commit

Permalink
Fix backend tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Auer <[email protected]>
  • Loading branch information
cau-git committed Aug 27, 2024
1 parent 4980b71 commit e59ea8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docling/models/layout_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def draw_clusters_and_cells():
clusters, page.cells, page.size.height
)

# draw_clusters_and_cells()
draw_clusters_and_cells()

page.predictions.layout = LayoutPrediction(clusters=clusters)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_backend_docling_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_doc_path():


def test_get_text_from_rect(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path)
doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
page_backend: DoclingParsePageBackend = doc_backend.load_page(0)

# Get the title text of the DocLayNet paper
Expand All @@ -30,7 +30,7 @@ def test_get_text_from_rect(test_doc_path):


def test_crop_page_image(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path)
doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
page_backend: DoclingParsePageBackend = doc_backend.load_page(0)

# Crop out "Figure 1" from the DocLayNet paper
Expand All @@ -41,5 +41,5 @@ def test_crop_page_image(test_doc_path):


def test_num_pages(test_doc_path):
doc_backend = DoclingParseDocumentBackend(test_doc_path)
doc_backend = DoclingParseDocumentBackend(test_doc_path, "123456xyz")
doc_backend.page_count() == 9
6 changes: 3 additions & 3 deletions tests/test_backend_pdfium.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_doc_path():


def test_get_text_from_rect(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path)
doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
page_backend: PyPdfiumPageBackend = doc_backend.load_page(0)

# Get the title text of the DocLayNet paper
Expand All @@ -28,7 +28,7 @@ def test_get_text_from_rect(test_doc_path):


def test_crop_page_image(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path)
doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
page_backend: PyPdfiumPageBackend = doc_backend.load_page(0)

# Crop out "Figure 1" from the DocLayNet paper
Expand All @@ -39,5 +39,5 @@ def test_crop_page_image(test_doc_path):


def test_num_pages(test_doc_path):
doc_backend = PyPdfiumDocumentBackend(test_doc_path)
doc_backend = PyPdfiumDocumentBackend(test_doc_path, "123456xyz")
doc_backend.page_count() == 9

0 comments on commit e59ea8e

Please sign in to comment.