Image-Text-to-Text
Transformers
Safetensors
qwen3_5
decision-model
system-one
flide
ocr
pdf
document-understanding
hf_jobs
conversational
Instructions to use davanstrien/ocr-decision-0.8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davanstrien/ocr-decision-0.8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="davanstrien/ocr-decision-0.8b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("davanstrien/ocr-decision-0.8b") model = AutoModelForMultimodalLM.from_pretrained("davanstrien/ocr-decision-0.8b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use davanstrien/ocr-decision-0.8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davanstrien/ocr-decision-0.8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davanstrien/ocr-decision-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/davanstrien/ocr-decision-0.8b
- SGLang
How to use davanstrien/ocr-decision-0.8b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "davanstrien/ocr-decision-0.8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davanstrien/ocr-decision-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "davanstrien/ocr-decision-0.8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davanstrien/ocr-decision-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use davanstrien/ocr-decision-0.8b with Docker Model Runner:
docker model run hf.co/davanstrien/ocr-decision-0.8b
Split README figures into full-width native-scale hero_examples.png + case_study_finepdfs.png and link FinePDFs
Browse files- .gitattributes +2 -0
- README.md +4 -2
- hero_overview.png → case_study_finepdfs.png +2 -2
- hero_examples.png +3 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
hero_overview.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
hero_overview.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
hero_examples.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
case_study_finepdfs.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -39,7 +39,7 @@ datasets:
|
|
| 39 |
|
| 40 |
Fine-tuned from [OmniJev/OneJev1.6-0.8B](https://huggingface.co/OmniJev/OneJev1.6-0.8B) (`Qwen3.5-0.8B`), it scores yes/no and multiple-choice questions over a page image (and optional transcription) in one forward pass without generating text (~20–27 ms/page on an RTX PRO 6000; no custom head — loads directly in [flide](https://github.com/OmniJev/Flide) or `transformers`).
|
| 41 |
|
| 42 |
-
 (`Qwen3.5-0.8B`), it scores yes/no and multiple-choice questions over a page image (and optional transcription) in one forward pass without generating text (~20–27 ms/page on an RTX PRO 6000; no custom head — loads directly in [flide](https://github.com/OmniJev/Flide) or `transformers`).
|
| 41 |
|
| 42 |
+

|
| 43 |
|
| 44 |
## Why & what it is for
|
| 45 |
|
|
|
|
| 213 |
|
| 214 |
Evaluated on an untouched 200-PDF / 865-page test set (silver ground truth from `LightOnOCR-3` comparing embedded text layers against VLM OCR) and weighted across 44,335 crawl pages:
|
| 215 |
|
| 216 |
+

|
| 217 |
+
|
| 218 |
| Router | Hardware | Needs-OCR F1 | Missing-layer recall | Pages sent to VLM OCR | Relative OCR GPU spend (`2048px`) |
|
| 219 |
|---|---|---:|---:|---:|---:|
|
| 220 |
+
| Production [FinePDFs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs) doc-level XGBoost | CPU | 0.595 | 84% | 19.0% | 1.00× (baseline) |
|
| 221 |
| **Distilled page-level XGBoost (`$0.28` teacher run)** | **CPU** | **0.777** | **97%** | **13.8%** | **0.63× (-37%)** |
|
| 222 |
| `ocr-decision-0.8b` direct | GPU | **0.800** | 97% | — | (also catches 4/7 mojibake pages vs. 0/7 for CPU XGB) |
|
| 223 |
|
hero_overview.png → case_study_finepdfs.png
RENAMED
|
File without changes
|
hero_examples.png
ADDED
|
Git LFS Details
|