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 lines6465666767686970707273717273351 unmodified lines42542642743143243343443542842943743043143243344143443543643711 unmodified lines44945045145945246146245345446545545645746846947045845946063 unmodified lineslogging.basicConfig(level=logging.INFO)logger = logging.getLogger(__name__)
# Prompt mode presets (from DeepSeek-OCR GitHub)# Prompt mode presets (from DeepSeek-OCR-2 model card)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 lines print("\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("\n2. Free OCR without layout:") print(" uv run deepseek-ocr2-vllm.py images text --prompt-mode free") print("\n4. Process a subset for testing:") print("\n3. 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("\n4. Running on HF Jobs:") print(" hf jobs uv run --flavor l4x1 \\") print(" -s HF_TOKEN \\") print(11 unmodified lines epilog="""Prompt Modes: document Convert document to markdown with grounding (default) image OCR any image with grounding free Free OCR without layout preservation figure Parse figures from documents describe Generate detailed image descriptions
Examples: # Basic usage # Basic usage (document mode with grounding) uv run deepseek-ocr2-vllm.py my-images-dataset ocr-results
# Parse figures from a document dataset uv run deepseek-ocr2-vllm.py scientific-papers figures --prompt-mode figure
# Free OCR without layout uv run deepseek-ocr2-vllm.py images text --prompt-mode free
deepseek-ocr2-vllm.py+5-18