Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
mtp
text-generation-inference
speculative-decoding
ocr
pdf
markdown
document-parsing
tables
charts
parsebench
MTP-Repacked
conversational
Instructions to use prithivMLmods/OCRia-1-MTP-Repacked with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/OCRia-1-MTP-Repacked with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/OCRia-1-MTP-Repacked") 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("prithivMLmods/OCRia-1-MTP-Repacked") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/OCRia-1-MTP-Repacked", 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 prithivMLmods/OCRia-1-MTP-Repacked with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/OCRia-1-MTP-Repacked" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/OCRia-1-MTP-Repacked", "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/prithivMLmods/OCRia-1-MTP-Repacked
- SGLang
How to use prithivMLmods/OCRia-1-MTP-Repacked 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 "prithivMLmods/OCRia-1-MTP-Repacked" \ --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": "prithivMLmods/OCRia-1-MTP-Repacked", "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 "prithivMLmods/OCRia-1-MTP-Repacked" \ --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": "prithivMLmods/OCRia-1-MTP-Repacked", "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 prithivMLmods/OCRia-1-MTP-Repacked with Docker Model Runner:
docker model run hf.co/prithivMLmods/OCRia-1-MTP-Repacked
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,4 +21,4 @@ pipeline_tag: image-text-to-text
|
|
| 21 |
|
| 22 |
# **OCRia-1-MTP-Repacked**
|
| 23 |
|
| 24 |
-
**OCRia-1** is a 4B-parameter vision-language model developed by LlamaIndex on top of **Qwen3.5-4B** for high-fidelity single-page document parsing directly from page images without external OCR engines or text layers. Trained on 100,979 real and synthetic pages via supervised fine-tuning, GRPO reinforcement learning with verifiable dimension-specific rewards, and checkpoint averaging, it transcribes complex documents into structured Markdown—converting multi-level and merged-cell tables (`colspan`/`rowspan`) as well as plot charts into HTML `<table>` elements, diagrams into Mermaid blocks, math and handwriting into LaTeX, and fine-grained formatting (strikethrough, underlines, highlights, checkboxes, page furniture, and watermarks) into semantic tags, with optional post-hoc visual grounding via `ocria_grounding`. Ranking as the top open-weight model on both **ParseBench 2** (85.24 overall across 4,317 pages) and **ParseBench 1** (84.65 overall across 2,078 pages, scoring 82.47 on charts), it is distributed in unoptimized BF16 weights (`10.35 GB`) for `vLLM`, `Transformers`, and `Ollama` under the custom **OCRia-1 Model and Code License** (free for research, personal use, and non-competing organizations under $2M in annual revenue and funding).
|
|
|
|
| 21 |
|
| 22 |
# **OCRia-1-MTP-Repacked**
|
| 23 |
|
| 24 |
+
> **OCRia-1** is a 4B-parameter vision-language model developed by LlamaIndex on top of **Qwen3.5-4B** for high-fidelity single-page document parsing directly from page images without external OCR engines or text layers. Trained on 100,979 real and synthetic pages via supervised fine-tuning, GRPO reinforcement learning with verifiable dimension-specific rewards, and checkpoint averaging, it transcribes complex documents into structured Markdown—converting multi-level and merged-cell tables (`colspan`/`rowspan`) as well as plot charts into HTML `<table>` elements, diagrams into Mermaid blocks, math and handwriting into LaTeX, and fine-grained formatting (strikethrough, underlines, highlights, checkboxes, page furniture, and watermarks) into semantic tags, with optional post-hoc visual grounding via `ocria_grounding`. Ranking as the top open-weight model on both **ParseBench 2** (85.24 overall across 4,317 pages) and **ParseBench 1** (84.65 overall across 2,078 pages, scoring 82.47 on charts), it is distributed in unoptimized BF16 weights (`10.35 GB`) for `vLLM`, `Transformers`, and `Ollama` under the custom **OCRia-1 Model and Code License** (free for research, personal use, and non-competing organizations under $2M in annual revenue and funding).
|