Skip to content

Commit cc7e627

Browse files
author
prima
committed
feat: Small improvements for PDF processing logging
1 parent 2347ee3 commit cc7e627

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

koboldcpp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,7 @@ def clamp_bbox(bbox, page_width, page_height):
17781778
for idx, table in enumerate(table_json_outputs, start=1):
17791779
page_output += f'"table {idx}":\n{table}\n'
17801780

1781+
print(f"Finished processing PDF page {page_number}")
17811782
return page_number, page_output
17821783

17831784
def run_serial(pages):
@@ -1789,7 +1790,7 @@ def run_parallel(pages):
17891790

17901791
# Parallel execution based on either the number of pages or number of CPU cores
17911792
num_cores = min(cpu_count(), len(pages))
1792-
print(f"Started processing PDF with {num_cores} cores...")
1793+
print(f"Started processing PDF document with {len(pages)} using {num_cores} cores...")
17931794
with ThreadPoolExecutor(max_workers=5) as exe:
17941795
return exe.map(process_page, pages)
17951796
# exe.submit(cube,2)
@@ -1824,6 +1825,8 @@ def run_parallel(pages):
18241825
sorted_results = sorted(results, key=lambda x: x[0])
18251826
final_output = "\n".join(page_output for _, page_output in sorted_results)
18261827

1828+
print(f"Finished processing PDF")
1829+
18271830
return final_output
18281831
return ""
18291832

0 commit comments

Comments
 (0)