From c97ce8bcd497f5c398f9e437bb82b2243c9482b3 Mon Sep 17 00:00:00 2001 From: Jake Poznanski Date: Fri, 16 May 2025 22:40:54 +0000 Subject: [PATCH] Lints --- olmocr/bench/prompts.py | 14 +++++++------- olmocr/bench/runners/run_gemini.py | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/olmocr/bench/prompts.py b/olmocr/bench/prompts.py index 5b276b8..b8c355a 100644 --- a/olmocr/bench/prompts.py +++ b/olmocr/bench/prompts.py @@ -4,13 +4,13 @@ def build_basic_prompt() -> str: def build_openai_silver_data_prompt_no_document_anchoring(_base_text: str) -> str: return ( - f"Below is the image of one page of a PDF document. " - f"Just return the plain text representation of this document as if you were reading it naturally.\n" - f"Turn equations into a LaTeX representation, and tables into markdown format. Remove the headers and footers, but keep references and footnotes.\n" - f"Read any natural handwriting.\n" - f"This is likely one page out of several in the document, so be sure to preserve any sentences that come from the previous page, or continue onto the next page, exactly as they are.\n" - f"If there is no text at all that you think you should read, you can output null.\n" - f"Do not hallucinate." + "Below is the image of one page of a PDF document. " + "Just return the plain text representation of this document as if you were reading it naturally.\n" + "Turn equations into a LaTeX representation, and tables into markdown format. Remove the headers and footers, but keep references and footnotes.\n" + "Read any natural handwriting.\n" + "This is likely one page out of several in the document, so be sure to preserve any sentences that come from the previous page, or continue onto the next page, exactly as they are.\n" + "If there is no text at all that you think you should read, you can output null.\n" + "Do not hallucinate." ) diff --git a/olmocr/bench/runners/run_gemini.py b/olmocr/bench/runners/run_gemini.py index 62de71d..8b95476 100644 --- a/olmocr/bench/runners/run_gemini.py +++ b/olmocr/bench/runners/run_gemini.py @@ -7,12 +7,11 @@ from google import genai from google.genai import types from olmocr.bench.prompts import ( - build_basic_prompt, build_openai_silver_data_prompt_no_document_anchoring, ) from olmocr.data.renderpdf import render_pdf_to_base64png from olmocr.prompts.anchor import get_anchor_text -from olmocr.prompts.prompts import PageResponse, build_openai_silver_data_prompt +from olmocr.prompts.prompts import build_openai_silver_data_prompt def run_gemini(