Commit ·
5f17daf
1
Parent(s): 79f3d9e
Trim prompt modes to official v2 ones (document, free)
Browse filesDeepSeek-OCR-2 model card only documents two prompts.
Remove image/figure/describe modes carried over from v1.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
63 unmodified lines64656667686970717273747576351 unmodified lines42842943043143243343443543643743843944044144244344411 unmodified lines45645745845946046146246346446546646746846947047147247363 unmodified lineslogging.basicConfig(level=logging.INFO)logger = logging.getLogger(__name__)# Prompt mode presets (from DeepSeek-OCR GitHub)PROMPT_MODES = {"document": "<image>\n<|grounding|>Convert the document to markdown.","image": "<image>\n<|grounding|>OCR this image.","free": "<image>\nFree OCR.","figure": "<image>\nParse the figure.","describe": "<image>\nDescribe this image in detail.",}351 unmodified linesprint("\nExample usage:")print("\n1. Basic OCR conversion (document mode with grounding):")print(" uv run deepseek-ocr2-vllm.py document-images markdown-docs")print("\n2. Parse figures from documents:")print(" uv run deepseek-ocr2-vllm.py scientific-papers figures --prompt-mode figure")print("\n3. Free OCR without layout:")print(" uv run deepseek-ocr2-vllm.py images text --prompt-mode free")print("\n4. Process a subset for testing:")print(" uv run deepseek-ocr2-vllm.py large-dataset test-output --max-samples 10")print("\n5. Running on HF Jobs:")print(" hf jobs uv run --flavor l4x1 \\")print(" -s HF_TOKEN \\")print(11 unmodified linesepilog="""Prompt Modes:document Convert document to markdown with grounding (default)image OCR any image with groundingfree Free OCR without layout preservationfigure Parse figures from documentsdescribe Generate detailed image descriptionsExamples:# Basic usageuv run deepseek-ocr2-vllm.py my-images-dataset ocr-results# Parse figures from a document datasetuv run deepseek-ocr2-vllm.py scientific-papers figures --prompt-mode figure# Free OCR without layoutuv run deepseek-ocr2-vllm.py images text --prompt-mode free63 unmodified lines64656667686970717273351 unmodified lines42542642742842943043143243343443543643711 unmodified lines44945045145245345445545645745845946063 unmodified lineslogging.basicConfig(level=logging.INFO)logger = logging.getLogger(__name__)# Prompt mode presets (from DeepSeek-OCR-2 model card)PROMPT_MODES = {"document": "<image>\n<|grounding|>Convert the document to markdown.","free": "<image>\nFree OCR.",}351 unmodified linesprint("\nExample usage:")print("\n1. Basic OCR conversion (document mode with grounding):")print(" uv run deepseek-ocr2-vllm.py document-images markdown-docs")print("\n2. Free OCR without layout:")print(" uv run deepseek-ocr2-vllm.py images text --prompt-mode free")print("\n3. Process a subset for testing:")print(" uv run deepseek-ocr2-vllm.py large-dataset test-output --max-samples 10")print("\n4. Running on HF Jobs:")print(" hf jobs uv run --flavor l4x1 \\")print(" -s HF_TOKEN \\")print(11 unmodified linesepilog="""Prompt Modes:document Convert document to markdown with grounding (default)free Free OCR without layout preservationExamples:# Basic usage (document mode with grounding)uv run deepseek-ocr2-vllm.py my-images-dataset ocr-results# Free OCR without layoutuv run deepseek-ocr2-vllm.py images text --prompt-mode free
deepseek-ocr2-vllm.py+5-18