Spaces:
Running on Zero
Running on Zero
| title: PaDoc Document Parser | |
| emoji: π | |
| colorFrom: indigo | |
| colorTo: pink | |
| sdk: gradio | |
| sdk_version: 6.22.0 | |
| app_file: app.py | |
| short_description: Parse document layout regions and content with PaDoc | |
| python_version: "3.12" | |
| startup_duration_timeout: 1h | |
| ## PaDoc: Layout-Grounded Parallel Decoding for Document Parsing | |
| This Space demonstrates **[PaDoc](https://huggingface.co/Longin-Yu/PaDoc)**, an end-to-end | |
| document parser that leverages parallel decoding. A single image-text model emits a compact | |
| main sequence of layout boxes and starts independent content branches at learned fork tokens β | |
| no draft model or additional prediction head is required. | |
| ### How it works | |
| 1. Upload a document image (or try one of the examples). | |
| 2. Click **Parse document** β the model predicts layout bounding boxes in `[0, 1000]` | |
| coordinates and decodes a content branch for each region. | |
| 3. The annotated image shows detected regions; the markdown output lists each region's | |
| category and extracted text. | |
| ### Execution modes | |
| - **Sequential** (default): batch=1 reference decoding β finishes each branch before | |
| resuming the main stream. | |
| - **Parallel**: prefills the prompt once, snapshots the parent KV cache at each fork, | |
| and advances the main stream plus all active branches together in one lockstep GPU batch. | |
| ### Model | |
| - **Model:** [Longin-Yu/PaDoc](https://huggingface.co/Longin-Yu/PaDoc) (Qwen3-VL 2B base) | |
| - **Paper:** [arXiv:2608.06146](https://arxiv.org/abs/2608.06146) | |
| - **Code:** [GitHub](https://github.com/Longin-Yu/Padoc) | |
| ### License | |
| Model weights are under CC-BY-NC-4.0. Example document images are generated for this demo. |