Instructions to use SetonLiang2/DocPilot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SetonLiang2/DocPilot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SetonLiang2/DocPilot")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SetonLiang2/DocPilot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SetonLiang2/DocPilot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SetonLiang2/DocPilot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SetonLiang2/DocPilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SetonLiang2/DocPilot
- SGLang
How to use SetonLiang2/DocPilot 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 "SetonLiang2/DocPilot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SetonLiang2/DocPilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "SetonLiang2/DocPilot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SetonLiang2/DocPilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SetonLiang2/DocPilot with Docker Model Runner:
docker model run hf.co/SetonLiang2/DocPilot
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,15 +13,19 @@ tags:
|
|
| 13 |
|
| 14 |
DocPilot-4B is a 4B action-tag model for long visual document understanding.
|
| 15 |
Weights are in the `DocPilot-4B` folder.
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
## Requirements
|
| 20 |
|
|
|
|
| 21 |
pip install vllm transformers
|
|
|
|
| 22 |
|
| 23 |
## Quickstart
|
| 24 |
|
|
|
|
| 25 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 26 |
|
| 27 |
model = AutoModelForImageTextToText.from_pretrained(
|
|
@@ -34,28 +38,35 @@ processor = AutoProcessor.from_pretrained(
|
|
| 34 |
"SetonLiang2/DocPilot",
|
| 35 |
subfolder="DocPilot-4B",
|
| 36 |
)
|
|
|
|
| 37 |
|
| 38 |
## Deployment
|
| 39 |
|
| 40 |
vLLM reads a local folder directly. Download the subfolder, then serve it:
|
| 41 |
|
|
|
|
| 42 |
huggingface-cli download SetonLiang2/DocPilot --include "DocPilot-4B/*" --local-dir ./DocPilot
|
| 43 |
vllm serve ./DocPilot/DocPilot-4B --host 0.0.0.0 --port 8088 --dtype bfloat16
|
|
|
|
| 44 |
|
| 45 |
Point DocPilot at this server with `protocol: vllm_tags`:
|
| 46 |
|
|
|
|
| 47 |
llm:
|
| 48 |
provider: openai
|
| 49 |
protocol: vllm_tags
|
| 50 |
model: ./DocPilot/DocPilot-4B
|
| 51 |
base_url: http://127.0.0.1:8088/v1
|
| 52 |
api_key: EMPTY
|
|
|
|
| 53 |
|
| 54 |
## Citation
|
| 55 |
|
|
|
|
| 56 |
@article{liang2026docpilot,
|
| 57 |
title={DocPilot: Interactive Agent Orchestration and Training for Long Visual Document Understanding},
|
| 58 |
author={Liang, Zhuowen and Lin, Xiaotian and Luo, Yuyu and Wang, Haixun and Tang, Nan},
|
| 59 |
journal={arXiv preprint arXiv:2610.21327},
|
| 60 |
year={2026}
|
| 61 |
-
}
|
|
|
|
|
|
| 13 |
|
| 14 |
DocPilot-4B is a 4B action-tag model for long visual document understanding.
|
| 15 |
Weights are in the `DocPilot-4B` folder.
|
| 16 |
+
|
| 17 |
+
- Paper: https://arxiv.org/abs/2610.21327
|
| 18 |
+
- Code: https://github.com/HKUSTDial/DocPilot
|
| 19 |
|
| 20 |
## Requirements
|
| 21 |
|
| 22 |
+
```bash
|
| 23 |
pip install vllm transformers
|
| 24 |
+
```
|
| 25 |
|
| 26 |
## Quickstart
|
| 27 |
|
| 28 |
+
```python
|
| 29 |
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 30 |
|
| 31 |
model = AutoModelForImageTextToText.from_pretrained(
|
|
|
|
| 38 |
"SetonLiang2/DocPilot",
|
| 39 |
subfolder="DocPilot-4B",
|
| 40 |
)
|
| 41 |
+
```
|
| 42 |
|
| 43 |
## Deployment
|
| 44 |
|
| 45 |
vLLM reads a local folder directly. Download the subfolder, then serve it:
|
| 46 |
|
| 47 |
+
```bash
|
| 48 |
huggingface-cli download SetonLiang2/DocPilot --include "DocPilot-4B/*" --local-dir ./DocPilot
|
| 49 |
vllm serve ./DocPilot/DocPilot-4B --host 0.0.0.0 --port 8088 --dtype bfloat16
|
| 50 |
+
```
|
| 51 |
|
| 52 |
Point DocPilot at this server with `protocol: vllm_tags`:
|
| 53 |
|
| 54 |
+
```yaml
|
| 55 |
llm:
|
| 56 |
provider: openai
|
| 57 |
protocol: vllm_tags
|
| 58 |
model: ./DocPilot/DocPilot-4B
|
| 59 |
base_url: http://127.0.0.1:8088/v1
|
| 60 |
api_key: EMPTY
|
| 61 |
+
```
|
| 62 |
|
| 63 |
## Citation
|
| 64 |
|
| 65 |
+
```bibtex
|
| 66 |
@article{liang2026docpilot,
|
| 67 |
title={DocPilot: Interactive Agent Orchestration and Training for Long Visual Document Understanding},
|
| 68 |
author={Liang, Zhuowen and Lin, Xiaotian and Luo, Yuyu and Wang, Haixun and Tang, Nan},
|
| 69 |
journal={arXiv preprint arXiv:2610.21327},
|
| 70 |
year={2026}
|
| 71 |
+
}
|
| 72 |
+
```
|