Image-Text-to-Text
Transformers
Safetensors
English
Chinese
internvl_chat
feature-extraction
visual-language
paddleocr
document-parse
HPD-Parsing
speculative-decoding
P-MTP
eval results
conversational
custom_code
Instructions to use PaddlePaddle/HPD-Parsing with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PaddlePaddle/HPD-Parsing with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PaddlePaddle/HPD-Parsing", trust_remote_code=True) 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PaddlePaddle/HPD-Parsing", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PaddlePaddle/HPD-Parsing with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PaddlePaddle/HPD-Parsing" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PaddlePaddle/HPD-Parsing", "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/PaddlePaddle/HPD-Parsing
- SGLang
How to use PaddlePaddle/HPD-Parsing 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 "PaddlePaddle/HPD-Parsing" \ --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": "PaddlePaddle/HPD-Parsing", "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 "PaddlePaddle/HPD-Parsing" \ --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": "PaddlePaddle/HPD-Parsing", "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 PaddlePaddle/HPD-Parsing with Docker Model Runner:
docker model run hf.co/PaddlePaddle/HPD-Parsing
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -44,6 +44,7 @@ HPD-Parsing: Hierarchical Parallel Document Parsing
|
|
| 44 |
|
| 45 |
## News
|
| 46 |
|
|
|
|
| 47 |
* ```2026.07``` ๐ We release **HPD-Parsing**, a 1B hierarchical parallel document parser. It achieves 94.91% overall on OmniDocBench v1.6 and 4,752 TPS peak throughput.
|
| 48 |
|
| 49 |
|
|
@@ -83,27 +84,24 @@ HPD-Parsing adopts **InternVL3.5-1B** as its backbone, applies dynamic tile-base
|
|
| 83 |
HPD-Parsing runs on a **customized build of vLLM** (based on vLLM v0.17.1) that implements the dynamic request forking required by hierarchical parallel decoding and adapts P-MTP speculative decoding.
|
| 84 |
|
| 85 |
|
| 86 |
-
### 1.
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
-
**
|
| 91 |
-
|
| 92 |
-
```text
|
| 93 |
-
ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/hpd-parsing-vllm:latest-nvidia-gpu
|
| 94 |
-
```
|
| 95 |
-
|
| 96 |
-
The default entrypoint starts the inference server automatically (see Serving below). It is pulled automatically on the first `docker run`. For machines without internet access, use the offline image `...:latest-nvidia-gpu-offline` (~24.5 GB; it has the model weights built in). Pull it on a networked machine and transfer it:
|
| 97 |
|
| 98 |
```shell
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
| 104 |
```
|
| 105 |
|
| 106 |
-
|
|
|
|
|
|
|
| 107 |
|
| 108 |
```shell
|
| 109 |
python -m venv .venv_hpd_parsing
|
|
@@ -111,7 +109,7 @@ source .venv_hpd_parsing/bin/activate
|
|
| 111 |
python -m pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/PaddleX3.0/deploy/hpd_parsing/vllm-0.17.1+hpdparsing-cp38-abi3-manylinux_2_31_x86_64.whl
|
| 112 |
```
|
| 113 |
|
| 114 |
-
|
| 115 |
|
| 116 |
```python
|
| 117 |
# Set the environment variable before running: export MAX_PATCHES_WITH_RESIZE=true
|
|
|
|
| 44 |
|
| 45 |
## News
|
| 46 |
|
| 47 |
+
* ```2026.07``` ๐ A live demo is available at [hugging-apps/hpd-parsing](https://huggingface.co/spaces/hugging-apps/hpd-parsing). Thanks to [multimodalart](https://huggingface.co/multimodalart) for building it!
|
| 48 |
* ```2026.07``` ๐ We release **HPD-Parsing**, a 1B hierarchical parallel document parser. It achieves 94.91% overall on OmniDocBench v1.6 and 4,752 TPS peak throughput.
|
| 49 |
|
| 50 |
|
|
|
|
| 84 |
HPD-Parsing runs on a **customized build of vLLM** (based on vLLM v0.17.1) that implements the dynamic request forking required by hierarchical parallel decoding and adapts P-MTP speculative decoding.
|
| 85 |
|
| 86 |
|
| 87 |
+
### 1. Using Docker
|
| 88 |
|
| 89 |
+
The Docker image ships the customized vLLM build and all dependencies, which is the easiest way to get started. Its default entrypoint runs the Python API example below out of the box.
|
| 90 |
|
| 91 |
+
**With the online Docker image**, start the container directly. It downloads the model and starts the inference server, which listens on port **8118** by default:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
```shell
|
| 94 |
+
docker run \
|
| 95 |
+
-it \
|
| 96 |
+
--rm \
|
| 97 |
+
--gpus all \
|
| 98 |
+
--network host \
|
| 99 |
+
ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/hpd-parsing-vllm:latest-nvidia-gpu
|
| 100 |
```
|
| 101 |
|
| 102 |
+
### 2. vLLM Python API
|
| 103 |
+
|
| 104 |
+
Without Docker, install the customized vLLM prebuilt package (Python 3.10โ3.13, NVIDIA driver with CUDA 12.8+) in a virtual environment to avoid dependency conflicts:
|
| 105 |
|
| 106 |
```shell
|
| 107 |
python -m venv .venv_hpd_parsing
|
|
|
|
| 109 |
python -m pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/PaddleX3.0/deploy/hpd_parsing/vllm-0.17.1+hpdparsing-cp38-abi3-manylinux_2_31_x86_64.whl
|
| 110 |
```
|
| 111 |
|
| 112 |
+
Then run inference with the vLLM Python API:
|
| 113 |
|
| 114 |
```python
|
| 115 |
# Set the environment variable before running: export MAX_PATCHES_WITH_RESIZE=true
|