Skip to content

Commit 82aad96

Browse files
committed
[Llama] Improved int page structure and naming
1 parent 3a34b40 commit 82aad96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymupdf4llm/pymupdf4llm/llama/pdf_markdown_reader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import fitz
99

1010
from fitz import Document as FitzDocument
11-
from pymupdf4llm import to_markdown, IdentifyHeaders
11+
12+
from pymupdf4llm import IdentifyHeaders, to_markdown
1213

1314
try:
1415
from llama_index.core.readers.base import BaseReader
@@ -143,7 +144,7 @@ def _process_doc_meta(
143144
):
144145
"""Processes metas of a PDF document."""
145146
extra_info.update(doc.metadata)
146-
extra_info["page_number"] = f"{page_number+1}"
147+
extra_info["page"] = page_number + 1
147148
extra_info["total_pages"] = len(doc)
148149
extra_info["file_path"] = str(file_path)
149150

0 commit comments

Comments
 (0)