Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/custom changes #2095

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[wip] trying to fix page numbers
  • Loading branch information
zoazhyga committed Sep 5, 2024
commit f592ae712c907fa16ec5455757d62f715412c06d
7 changes: 4 additions & 3 deletions private_gpt/components/ingest/ingest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ def _load_file_to_documents(file_name: str, file_data: Path) -> list[Document]:
text = pytesseract.image_to_string(image, lang="rus")
doc = StringIterableReader().load_data(
[text],
)[0]
doc.metadata["page_label"] = i
)
# )[0]
# doc.metadata["page_label"] = str(i + 1)

documents.extend(doc)
documents.extend([doc])
except Exception as e:
logger.error(f"Error extracting images from PDF: {e}")
raise ValueError(f"No text extracted from PDF={file_name}")
Expand Down