Image-Text-to-Text
Transformers
Safetensors
qwen3_5
ocr
document-parsing
document-understanding
markdown
latex
table-recognition
multilingual
vllm
conversational
Instructions to use sionic-ai/PepperOCR-VL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sionic-ai/PepperOCR-VL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sionic-ai/PepperOCR-VL") 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("sionic-ai/PepperOCR-VL") model = AutoModelForMultimodalLM.from_pretrained("sionic-ai/PepperOCR-VL", 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 sionic-ai/PepperOCR-VL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sionic-ai/PepperOCR-VL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sionic-ai/PepperOCR-VL", "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/sionic-ai/PepperOCR-VL
- SGLang
How to use sionic-ai/PepperOCR-VL 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 "sionic-ai/PepperOCR-VL" \ --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": "sionic-ai/PepperOCR-VL", "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 "sionic-ai/PepperOCR-VL" \ --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": "sionic-ai/PepperOCR-VL", "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 sionic-ai/PepperOCR-VL with Docker Model Runner:
docker model run hf.co/sionic-ai/PepperOCR-VL
Model card: add the exact inference settings behind the reported scores
Browse files
README.md
CHANGED
|
@@ -92,16 +92,47 @@ Message layout:
|
|
| 92 |
```
|
| 93 |
|
| 94 |
Keep thinking mode off (`enable_thinking: false`); the model was tuned and
|
| 95 |
-
evaluated without it.
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
## Quickstart
|
| 100 |
|
| 101 |
### vLLM
|
| 102 |
|
| 103 |
```bash
|
| 104 |
-
vllm serve sionic-ai/PepperOCR-VL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
```
|
| 106 |
|
| 107 |
```python
|
|
@@ -119,8 +150,12 @@ response = client.chat.completions.create(
|
|
| 119 |
{"type": "text", "text": prompt},
|
| 120 |
]}],
|
| 121 |
temperature=0.0,
|
|
|
|
| 122 |
max_tokens=8192,
|
|
|
|
|
|
|
| 123 |
extra_body={
|
|
|
|
| 124 |
"repetition_penalty": 1.05,
|
| 125 |
"no_repeat_ngram_size": 30,
|
| 126 |
"chat_template_kwargs": {"enable_thinking": False},
|
|
|
|
| 92 |
```
|
| 93 |
|
| 94 |
Keep thinking mode off (`enable_thinking: false`); the model was tuned and
|
| 95 |
+
evaluated without it. The decoding settings are in the next section.
|
| 96 |
+
|
| 97 |
+
## Recommended inference settings
|
| 98 |
+
|
| 99 |
+
This is the exact configuration behind the reported scores. Use it as is
|
| 100 |
+
unless you have a reason to change it.
|
| 101 |
+
|
| 102 |
+
| Setting | Value | Note |
|
| 103 |
+
|---|---|---|
|
| 104 |
+
| Precision | bf16 | as shipped |
|
| 105 |
+
| `temperature` | 0 | greedy |
|
| 106 |
+
| `top_p` / `top_k` | 1.0 / -1 | no truncation |
|
| 107 |
+
| `repetition_penalty` | 1.05 | mild; keeps long tables from looping |
|
| 108 |
+
| `no_repeat_ngram_size` | 30 | blocks verbatim repetition of long spans |
|
| 109 |
+
| `presence_penalty` | 0 | |
|
| 110 |
+
| `max_tokens` | 8192 | enough for dense pages |
|
| 111 |
+
| `seed` | 42 | for repeatability with greedy decoding |
|
| 112 |
+
| `enable_thinking` | false | chat-template kwarg |
|
| 113 |
+
| Image size | processor defaults | no `min_pixels`/`max_pixels` override |
|
| 114 |
+
| Context (`--max-model-len`) | 32768 | |
|
| 115 |
+
| Batching (`--max-num-seqs`) | 64 | with 64 concurrent requests per GPU |
|
| 116 |
+
| GPU memory | `--gpu-memory-utilization 0.85` | capped at 74 GiB on larger cards |
|
| 117 |
+
| Orientation preprocessing | on, threshold 0.85 | see `orientation/` |
|
| 118 |
+
| Runaway-output retry | temperatures 0.1, 0.3, 0.5, 0.8 | when output hits `max_tokens` or compresses below gzip ratio 0.18; keep the shortest non-degenerate result |
|
| 119 |
+
|
| 120 |
+
Software used for the reported scores: vLLM 0.24.0, PyTorch 2.11.0 (CUDA 13),
|
| 121 |
+
Transformers 5.11.0, FlashInfer 0.6.12, `--gdn-prefill-backend triton`;
|
| 122 |
+
PaddlePaddle 3.2.2 (CPU) for orientation. Newer versions should work but were
|
| 123 |
+
not used for the numbers below.
|
| 124 |
|
| 125 |
## Quickstart
|
| 126 |
|
| 127 |
### vLLM
|
| 128 |
|
| 129 |
```bash
|
| 130 |
+
vllm serve sionic-ai/PepperOCR-VL \
|
| 131 |
+
--served-model-name pepperocr-vl \
|
| 132 |
+
--max-model-len 32768 \
|
| 133 |
+
--max-num-seqs 64 \
|
| 134 |
+
--gpu-memory-utilization 0.85 \
|
| 135 |
+
--gdn-prefill-backend triton # vLLM 0.24; drop if your version does not have it
|
| 136 |
```
|
| 137 |
|
| 138 |
```python
|
|
|
|
| 150 |
{"type": "text", "text": prompt},
|
| 151 |
]}],
|
| 152 |
temperature=0.0,
|
| 153 |
+
top_p=1.0,
|
| 154 |
max_tokens=8192,
|
| 155 |
+
seed=42,
|
| 156 |
+
presence_penalty=0.0,
|
| 157 |
extra_body={
|
| 158 |
+
"top_k": -1,
|
| 159 |
"repetition_penalty": 1.05,
|
| 160 |
"no_repeat_ngram_size": 30,
|
| 161 |
"chat_template_kwargs": {"enable_thinking": False},
|