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
Demo for this model on Spaces
Hey @PaddlePaddle 🤗, it's me again, Poli from Hugging Face
You keep shipping 🚢 — congrats on PaddlePaddle/HPD-Parsing! Once again, me + my agent built an interactive demo app of it on Hugging Face Spaces, running on a free ZeroGPU infrastructure.
Here's a link to the demo: https://huggingface.co/spaces/hugging-apps/hpd-parsing
And you know the spiel, but it would be great to transfer it to your organization/user on Hugging Face. Just let me know which username/org to transfer over, we hope it can give your work more visibility, discoverability and allows folks to try it out.
In the future, feel free to already ship models with demos included. You can use this one as a blueprint to build by yourself or with the help of an agent — you can load the huggingface-spaces skill on Claude Code, Codex, Pi, etc.
(If you have any questions or just want to chat more about this, you can find me on Twitter, LinkedIn or apolinario @ huggingface.co)
Cheers,
Poli
@multimodalart Hi Poli, thanks again for building and sharing the interactive demo for HPD-Parsing!
Could you also help integrate our post-processing script into the demo app? The script converts the raw HPD-Parsing output into the final Markdown format and is available here:
https://huggingface.co/PaddlePaddle/HPD-Parsing/blob/main/eval/hpd_to_markdown.py
This would make the demo output more consistent with the official inference and evaluation pipeline. Thanks!
Hey @wjj1999 , you're welcome! Thanks for open sourcing. I would love to transfer the demo to your organization and once you have a hold of it, you can feel free to add this final step to it, what do you think?
You can use what's been done so far as a blueprint or with the help of an agent, you can load the huggingface-spaces skill for it
Let me know
@multimodalart Sounds good—thank you! Please transfer the Space to the PaddlePaddle organization, and we’ll take over the maintenance and integrate the post-processing step on our side.
The existing demo will be a very helpful starting point. Thanks again for building it and supporting the project!
Perfect @wjj1999 ! Will do, just as a confirmation step, could I get a thumbs up / approval from someone in the https://huggingface.co/PaddlePaddle org? Maybe @ChengCui who posted the model/paper? A post here is enough :)
@multimodalart Approved from our side 👍 Please transfer the Space to @WEISHU , who will take over its maintenance for the PaddlePaddle organization. Thanks!
@multimodalart Hi, thank you very much for this demo. Regarding adding some proper post-processing to improve the demo experience, I've opened a Discussion with the corresponding code (https://huggingface.co/spaces/hugging-apps/hpd-parsing/discussions/1)— please take a look and let me know if it's convenient to merge/adjust.
Hi @WEISHU ! Thank you for open sourcing, and great!
I've transferred the demo to the PaddlePaddle org as previously agreed on: https://huggingface.co/spaces/PaddlePaddle/hpd-parsing
So now once you own it, feel free to make all the changes you seem fit, maybe it's a best and faster project
Once it is to your liking, feel free to post about, put the demo on the project page, reference it on repos, etc. as you wish
Also, feel more than free to take all ownership and make all modifications as you see fit. For future releases from you, would be great if they already came with a demos! You can use this one as a blueprint to build by yourself or with the help of an agent, you can load the huggingface-spaces skill on Claude Code, Codex, Pi, etc.