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 :)