{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-05-18-paddleocr-3-5-running-ocr-and-document-parsing-tasks-with-a/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "PaddleOCR 3.5 brings OCR and document parsing tasks closer to the Hugging Face ecosystem. With this release, supported PaddleOCR models can run with **Hugging Face Transformers as an inference backend** by setting:\n\n```python\nengine=\"transformers\"\n```\n\nPaddleOCR continues to provide OCR model series such as **PP-OCRv5** and document parsing model series such as **PaddleOCR-VL 1.5**, while Transformers becomes one of the supported backends for running them.\n\nTry the live demo on Hugging Face Spaces: [https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\n## What changed?\n\nPaddleOCR 3.5 introduces a more flexible inference-engine interface. Developers can select the backend through the `engine` parameter and pass backend-specific options through `engine_config`.\n\nIn practice, this means:\n\n- The pipelines behind these tasks are managed by PaddleOCR, so developers do not need to manually call each internal component.\n- Transformers becomes one of the supported inference backends for running supported PaddleOCR models.\n- Developers can configure backend-related options such as `dtype`, device placement, and attention implementation through `engine_config`.\n\nA simple way to understand the stack:\n\n| Layer                       | What it means                                          | Examples                                                |\n| --------------------------- | ------------------------------------------------------ | ------------------------------------------------------- |\n| **Application layer**       | Applications that use OCR and document parsing outputs | RAG, agents, Document AI...                             |\n| **Model layer**             | OCR and document parsing capabilities                  | PP-OCRv5, PaddleOCR-VL 1.5...                           |\n| **Inference backend layer** | Runtime used to run supported models                   | Paddle static graph, Paddle dynamic graph, Transformers |\n\nThis release is mainly about the inference backend layer: PaddleOCR continues to provide OCR and document parsing capabilities, while Transformers gives supported PaddleOCR models another backend option that fits naturally into Hugging Face-centered environments. The larger Document AI workflow remains in the hands of developers and application builders.\n\n## Why this matters\n\nFor RAG, Document AI, and document agent applications, the hard part often starts before the LLM.\n\nDevelopers first need to turn PDFs, scanned documents, screenshots, tables, charts, formulas, and complex page layouts into reliable structured data. If this ingestion step is weak, the downstream LLM workflow may miss key information, retrieve the wrong context, or produce unreliable answers.\n\nPaddleOCR helps address this document ingestion challenge by providing OCR series models such as PP-OCRv5 and document parsing series models such as PaddleOCR-VL-1.5.\n\nWith PaddleOCR 3.5, these capabilities are now easier to connect with Transformers-centered stacks. Supported PaddleOCR models can run with a Transformers backend, while PaddleOCR continues to manage the OCR or document parsing pipeline behind the scenes.\n\nFor developers, this means less integration friction and a more natural path from documents to downstream RAG, agent, search, analytics, or automation workflows.\n\n## Quick start\n\nInstall PaddleOCR 3.5, PaddleX, Transformers, and a compatible PyTorch build for your hardware.\n\nFor example, on a CUDA 12.6 environment:\n\n```bash\npython -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126\npython -m pip install \"paddleocr==3.5.0\" \"paddlex==3.5.2\" \"transformers>=5.4.0\"\n```\n\nFor CPU, ROCm, or other environments, install the PyTorch build that matches your target hardware.\n\nRun from the command line:\n\n```bash\npaddleocr ocr \\\n  -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png \\\n  --device gpu:0 \\\n  --engine transformers\n```\n\nOr use the Python API:\n\n```python\nfrom paddleocr import PaddleOCR\n\npipeline = PaddleOCR(\n    device=\"gpu:0\",\n    engine=\"transformers\",\n    use_doc_orientation_classify=False,\n    use_doc_unwarping=False,\n    use_textline_orientation=False,\n    engine_config={\n        \"dtype\": \"float32\",\n    },\n)\n\nresults = pipeline.predict(\n    \"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png\"\n)\n\nfor result in results:\n    print(result)\n```\n\nThe Hugging Face Space uses `float32` for broad compatibility. For your own hardware, you can tune backend-specific options through `engine_config`:\n\n```python\nengine_config = {\n    \"dtype\": \"bfloat16\",\n    \"device_type\": \"gpu\",\n    \"device_id\": 0,\n    \"attn_implementation\": \"sdpa\",\n}\n```\n\nThe best configuration depends on your model, hardware, and deployment environment.\n\n## When should you use the Transformers backend?\n\nUse the Transformers backend when you want PaddleOCR’s OCR and document parsing capabilities to fit more naturally into a Hugging Face-centered stack.\n\nThis is especially useful if you are building RAG, Document AI, search, analytics, or agent applications and already rely on PyTorch / Transformers infrastructure for model loading, experimentation, deployment, or model artifact management.\n\nThe Transformers backend is a good fit when you want:\n\n- a more familiar development experience for teams already using Transformers,\n- Hub-compatible model discovery and distribution for supported PaddleOCR models,\n- easier integration with existing PyTorch / Transformers services.\n\nWhen maximizing OCR or document parsing throughput is the priority, PaddleOCR’s default `paddle_static` backend is usually the recommended choice.\n\nThis release is not about replacing one backend with another. It is about giving developers more flexibility: use PaddleOCR for OCR and document parsing capabilities, and choose the inference backend that best fits your stack.\n\n## Try it now\n\nTry the PaddleOCR 3.5 Transformers demo on Hugging Face Spaces:\n\n[https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\nExplore PaddleOCR models on the Hub:\n\n[https://huggingface.co/PaddlePaddle/models](https://huggingface.co/PaddlePaddle/models)\n\nPaddleOCR 3.5 brings OCR and document parsing capabilities closer to Transformers-centered workflows, while giving developers the freedom to build the larger Document AI applications around them.\n\n## Resources\n\n- PaddleOCR documentation: [https://www.paddleocr.ai/](https://www.paddleocr.ai/)\n- PaddleOCR on GitHub: [https://github.com/PaddlePaddle/PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)\n- PaddlePaddle organization on Hugging Face: [https://huggingface.co/PaddlePaddle](https://huggingface.co/PaddlePaddle)\n- PaddleOCR 3.5 Transformers demo on Spaces: [https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\n## Acknowledgements\n\nWe sincerely thank the Hugging Face engineers who supported the PaddleOCR 3.5 Transformers integration.\n\nSpecial thanks to [Anton Vlasjuk](https://huggingface.co/AntonV) for his end-to-end involvement, including reviewing and merging all related pull requests.\n\nWe also appreciate [Raushan Turganbay](https://huggingface.co/RaushanTurganbay) and [Yoni Gozlan](https://huggingface.co/yonigozlan) for their valuable PR reviews and feedback.\n\nTheir guidance helped improve the integration quality, documentation, and developer experience for the Hugging Face community.\n",
  "authors": [],
  "captured_at": "2026-10-19T01:26:53.998049939+00:00",
  "category": "ai",
  "content_html": "<p>PaddleOCR 3.5 brings OCR and document parsing tasks closer to the Hugging Face ecosystem. With this release, supported PaddleOCR models can run with <strong>Hugging Face Transformers as an inference backend</strong> by setting:</p>\n<pre><code class=\"language-python\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">engine</span></span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">transformers<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span>\n</span></span></code></pre>\n<p>PaddleOCR continues to provide OCR model series such as <strong>PP-OCRv5</strong> and document parsing model series such as <strong>PaddleOCR-VL 1.5</strong>, while Transformers becomes one of the supported backends for running them.</p>\n<p>Try the live demo on Hugging Face Spaces: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo\">https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo</a></p>\n<h2>What changed?</h2>\n<p>PaddleOCR 3.5 introduces a more flexible inference-engine interface. Developers can select the backend through the <code>engine</code> parameter and pass backend-specific options through <code>engine_config</code>.</p>\n<p>In practice, this means:</p>\n<ul>\n<li>The pipelines behind these tasks are managed by PaddleOCR, so developers do not need to manually call each internal component.</li>\n<li>Transformers becomes one of the supported inference backends for running supported PaddleOCR models.</li>\n<li>Developers can configure backend-related options such as <code>dtype</code>, device placement, and attention implementation through <code>engine_config</code>.</li>\n</ul>\n<p>A simple way to understand the stack:</p>\n<table>\n<thead>\n<tr>\n<th>Layer</th>\n<th>What it means</th>\n<th>Examples</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Application layer</strong></td>\n<td>Applications that use OCR and document parsing outputs</td>\n<td>RAG, agents, Document AI...</td>\n</tr>\n<tr>\n<td><strong>Model layer</strong></td>\n<td>OCR and document parsing capabilities</td>\n<td>PP-OCRv5, PaddleOCR-VL 1.5...</td>\n</tr>\n<tr>\n<td><strong>Inference backend layer</strong></td>\n<td>Runtime used to run supported models</td>\n<td>Paddle static graph, Paddle dynamic graph, Transformers</td>\n</tr>\n</tbody>\n</table>\n<p>This release is mainly about the inference backend layer: PaddleOCR continues to provide OCR and document parsing capabilities, while Transformers gives supported PaddleOCR models another backend option that fits naturally into Hugging Face-centered environments. The larger Document AI workflow remains in the hands of developers and application builders.</p>\n<h2>Why this matters</h2>\n<p>For RAG, Document AI, and document agent applications, the hard part often starts before the LLM.</p>\n<p>Developers first need to turn PDFs, scanned documents, screenshots, tables, charts, formulas, and complex page layouts into reliable structured data. If this ingestion step is weak, the downstream LLM workflow may miss key information, retrieve the wrong context, or produce unreliable answers.</p>\n<p>PaddleOCR helps address this document ingestion challenge by providing OCR series models such as PP-OCRv5 and document parsing series models such as PaddleOCR-VL-1.5.</p>\n<p>With PaddleOCR 3.5, these capabilities are now easier to connect with Transformers-centered stacks. Supported PaddleOCR models can run with a Transformers backend, while PaddleOCR continues to manage the OCR or document parsing pipeline behind the scenes.</p>\n<p>For developers, this means less integration friction and a more natural path from documents to downstream RAG, agent, search, analytics, or automation workflows.</p>\n<h2>Quick start</h2>\n<p>Install PaddleOCR 3.5, PaddleX, Transformers, and a compatible PyTorch build for your hardware.</p>\n<p>For example, on a CUDA 12.6 environment:</p>\n<pre><code class=\"language-bash\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">python</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>m</span> pip install torch torchvision torchaudio<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>index-url</span> https://download.pytorch.org/whl/cu126</span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">python</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>m</span> pip install <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>paddleocr==3.5.0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>paddlex==3.5.2<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>transformers&gt;=5.4.0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span></span>\n</span></span></code></pre>\n<p>For CPU, ROCm, or other environments, install the PyTorch build that matches your target hardware.</p>\n<p>Run from the command line:</p>\n<pre><code class=\"language-bash\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">paddleocr</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> ocr <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">  -</span>i</span> https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">  --</span>device</span> gpu:0 <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">  --</span>engine</span> transformers</span>\n</span></span></code></pre>\n<p>Or use the Python API:</p>\n<pre><code class=\"language-python\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">paddleocr</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">PaddleOCR</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">pipeline</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">PaddleOCR</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-variable syntax-parameter syntax-python\">device</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">gpu:0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">engine</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">transformers<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">use_doc_orientation_classify</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">False</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">use_doc_unwarping</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">False</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">use_textline_orientation</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">False</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">engine_config</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">dtype<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">float32<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n    <span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">results</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">pipeline</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">predict</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-statement syntax-for syntax-python\"><span class=\"syntax-keyword syntax-control syntax-flow syntax-for syntax-python\">for</span> <span class=\"syntax-meta syntax-generic-name syntax-python\">result</span> <span class=\"syntax-meta syntax-statement syntax-for syntax-python\"><span class=\"syntax-keyword syntax-control syntax-flow syntax-for syntax-in syntax-python\">in</span></span></span><span class=\"syntax-meta syntax-statement syntax-for syntax-python\"> <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">results</span></span><span class=\"syntax-punctuation syntax-section syntax-block syntax-for syntax-python\">:</span></span>\n    <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-support syntax-function syntax-builtin syntax-python\">print</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">result</span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n</span></span></code></pre>\n<p>The Hugging Face Space uses <code>float32</code> for broad compatibility. For your own hardware, you can tune backend-specific options through <code>engine_config</code>:</p>\n<pre><code class=\"language-python\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">engine_config</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span>\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">dtype<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">bfloat16<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">device_type<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">gpu<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">device_id<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">0</span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">attn_implementation<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">sdpa<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span>\n<span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span>\n</span></span></code></pre>\n<p>The best configuration depends on your model, hardware, and deployment environment.</p>\n<h2>When should you use the Transformers backend?</h2>\n<p>Use the Transformers backend when you want PaddleOCR’s OCR and document parsing capabilities to fit more naturally into a Hugging Face-centered stack.</p>\n<p>This is especially useful if you are building RAG, Document AI, search, analytics, or agent applications and already rely on PyTorch / Transformers infrastructure for model loading, experimentation, deployment, or model artifact management.</p>\n<p>The Transformers backend is a good fit when you want:</p>\n<ul>\n<li>a more familiar development experience for teams already using Transformers,</li>\n<li>Hub-compatible model discovery and distribution for supported PaddleOCR models,</li>\n<li>easier integration with existing PyTorch / Transformers services.</li>\n</ul>\n<p>When maximizing OCR or document parsing throughput is the priority, PaddleOCR’s default <code>paddle_static</code> backend is usually the recommended choice.</p>\n<p>This release is not about replacing one backend with another. It is about giving developers more flexibility: use PaddleOCR for OCR and document parsing capabilities, and choose the inference backend that best fits your stack.</p>\n<h2>Try it now</h2>\n<p>Try the PaddleOCR 3.5 Transformers demo on Hugging Face Spaces:</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo\">https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo</a></p>\n<p>Explore PaddleOCR models on the Hub:</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/PaddlePaddle/models\">https://huggingface.co/PaddlePaddle/models</a></p>\n<p>PaddleOCR 3.5 brings OCR and document parsing capabilities closer to Transformers-centered workflows, while giving developers the freedom to build the larger Document AI applications around them.</p>\n<h2>Resources</h2>\n<ul>\n<li>PaddleOCR documentation: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.paddleocr.ai/\">https://www.paddleocr.ai/</a></li>\n<li>PaddleOCR on GitHub: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/PaddlePaddle/PaddleOCR\">https://github.com/PaddlePaddle/PaddleOCR</a></li>\n<li>PaddlePaddle organization on Hugging Face: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/PaddlePaddle\">https://huggingface.co/PaddlePaddle</a></li>\n<li>PaddleOCR 3.5 Transformers demo on Spaces: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo\">https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo</a></li>\n</ul>\n<h2>Acknowledgements</h2>\n<p>We sincerely thank the Hugging Face engineers who supported the PaddleOCR 3.5 Transformers integration.</p>\n<p>Special thanks to <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/AntonV\">Anton Vlasjuk</a> for his end-to-end involvement, including reviewing and merging all related pull requests.</p>\n<p>We also appreciate <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/RaushanTurganbay\">Raushan Turganbay</a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/yonigozlan\">Yoni Gozlan</a> for their valuable PR reviews and feedback.</p>\n<p>Their guidance helped improve the integration quality, documentation, and developer experience for the Hugging Face community.</p>\n",
  "content_markdown": "PaddleOCR 3.5 brings OCR and document parsing tasks closer to the Hugging Face ecosystem. With this release, supported PaddleOCR models can run with **Hugging Face Transformers as an inference backend** by setting:\n\n```python\nengine=\"transformers\"\n```\n\nPaddleOCR continues to provide OCR model series such as **PP-OCRv5** and document parsing model series such as **PaddleOCR-VL 1.5**, while Transformers becomes one of the supported backends for running them.\n\nTry the live demo on Hugging Face Spaces: [https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\n## What changed?\n\nPaddleOCR 3.5 introduces a more flexible inference-engine interface. Developers can select the backend through the `engine` parameter and pass backend-specific options through `engine_config`.\n\nIn practice, this means:\n\n- The pipelines behind these tasks are managed by PaddleOCR, so developers do not need to manually call each internal component.\n- Transformers becomes one of the supported inference backends for running supported PaddleOCR models.\n- Developers can configure backend-related options such as `dtype`, device placement, and attention implementation through `engine_config`.\n\nA simple way to understand the stack:\n\n| Layer                       | What it means                                          | Examples                                                |\n| --------------------------- | ------------------------------------------------------ | ------------------------------------------------------- |\n| **Application layer**       | Applications that use OCR and document parsing outputs | RAG, agents, Document AI...                             |\n| **Model layer**             | OCR and document parsing capabilities                  | PP-OCRv5, PaddleOCR-VL 1.5...                           |\n| **Inference backend layer** | Runtime used to run supported models                   | Paddle static graph, Paddle dynamic graph, Transformers |\n\nThis release is mainly about the inference backend layer: PaddleOCR continues to provide OCR and document parsing capabilities, while Transformers gives supported PaddleOCR models another backend option that fits naturally into Hugging Face-centered environments. The larger Document AI workflow remains in the hands of developers and application builders.\n\n## Why this matters\n\nFor RAG, Document AI, and document agent applications, the hard part often starts before the LLM.\n\nDevelopers first need to turn PDFs, scanned documents, screenshots, tables, charts, formulas, and complex page layouts into reliable structured data. If this ingestion step is weak, the downstream LLM workflow may miss key information, retrieve the wrong context, or produce unreliable answers.\n\nPaddleOCR helps address this document ingestion challenge by providing OCR series models such as PP-OCRv5 and document parsing series models such as PaddleOCR-VL-1.5.\n\nWith PaddleOCR 3.5, these capabilities are now easier to connect with Transformers-centered stacks. Supported PaddleOCR models can run with a Transformers backend, while PaddleOCR continues to manage the OCR or document parsing pipeline behind the scenes.\n\nFor developers, this means less integration friction and a more natural path from documents to downstream RAG, agent, search, analytics, or automation workflows.\n\n## Quick start\n\nInstall PaddleOCR 3.5, PaddleX, Transformers, and a compatible PyTorch build for your hardware.\n\nFor example, on a CUDA 12.6 environment:\n\n```bash\npython -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126\npython -m pip install \"paddleocr==3.5.0\" \"paddlex==3.5.2\" \"transformers>=5.4.0\"\n```\n\nFor CPU, ROCm, or other environments, install the PyTorch build that matches your target hardware.\n\nRun from the command line:\n\n```bash\npaddleocr ocr \\\n  -i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png \\\n  --device gpu:0 \\\n  --engine transformers\n```\n\nOr use the Python API:\n\n```python\nfrom paddleocr import PaddleOCR\n\npipeline = PaddleOCR(\n    device=\"gpu:0\",\n    engine=\"transformers\",\n    use_doc_orientation_classify=False,\n    use_doc_unwarping=False,\n    use_textline_orientation=False,\n    engine_config={\n        \"dtype\": \"float32\",\n    },\n)\n\nresults = pipeline.predict(\n    \"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png\"\n)\n\nfor result in results:\n    print(result)\n```\n\nThe Hugging Face Space uses `float32` for broad compatibility. For your own hardware, you can tune backend-specific options through `engine_config`:\n\n```python\nengine_config = {\n    \"dtype\": \"bfloat16\",\n    \"device_type\": \"gpu\",\n    \"device_id\": 0,\n    \"attn_implementation\": \"sdpa\",\n}\n```\n\nThe best configuration depends on your model, hardware, and deployment environment.\n\n## When should you use the Transformers backend?\n\nUse the Transformers backend when you want PaddleOCR’s OCR and document parsing capabilities to fit more naturally into a Hugging Face-centered stack.\n\nThis is especially useful if you are building RAG, Document AI, search, analytics, or agent applications and already rely on PyTorch / Transformers infrastructure for model loading, experimentation, deployment, or model artifact management.\n\nThe Transformers backend is a good fit when you want:\n\n- a more familiar development experience for teams already using Transformers,\n- Hub-compatible model discovery and distribution for supported PaddleOCR models,\n- easier integration with existing PyTorch / Transformers services.\n\nWhen maximizing OCR or document parsing throughput is the priority, PaddleOCR’s default `paddle_static` backend is usually the recommended choice.\n\nThis release is not about replacing one backend with another. It is about giving developers more flexibility: use PaddleOCR for OCR and document parsing capabilities, and choose the inference backend that best fits your stack.\n\n## Try it now\n\nTry the PaddleOCR 3.5 Transformers demo on Hugging Face Spaces:\n\n[https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\nExplore PaddleOCR models on the Hub:\n\n[https://huggingface.co/PaddlePaddle/models](https://huggingface.co/PaddlePaddle/models)\n\nPaddleOCR 3.5 brings OCR and document parsing capabilities closer to Transformers-centered workflows, while giving developers the freedom to build the larger Document AI applications around them.\n\n## Resources\n\n- PaddleOCR documentation: [https://www.paddleocr.ai/](https://www.paddleocr.ai/)\n- PaddleOCR on GitHub: [https://github.com/PaddlePaddle/PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)\n- PaddlePaddle organization on Hugging Face: [https://huggingface.co/PaddlePaddle](https://huggingface.co/PaddlePaddle)\n- PaddleOCR 3.5 Transformers demo on Spaces: [https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo](https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo)\n\n## Acknowledgements\n\nWe sincerely thank the Hugging Face engineers who supported the PaddleOCR 3.5 Transformers integration.\n\nSpecial thanks to [Anton Vlasjuk](https://huggingface.co/AntonV) for his end-to-end involvement, including reviewing and merging all related pull requests.\n\nWe also appreciate [Raushan Turganbay](https://huggingface.co/RaushanTurganbay) and [Yoni Gozlan](https://huggingface.co/yonigozlan) for their valuable PR reviews and feedback.\n\nTheir guidance helped improve the integration quality, documentation, and developer experience for the Hugging Face community.\n",
  "dateCreated": "2026-10-19T01:26:53.998049939+00:00",
  "date_created": "2026-05-18T15:12:46+00:00",
  "date_modified": "2026-05-18T15:12:46+00:00",
  "date_published": "2026-05-18T15:12:46+00:00",
  "description": "PaddleOCR 3.5 brings OCR and document parsing tasks closer to the Hugging Face ecosystem. With this release, supported PaddleOCR models can run with Hugging Face Transformers as an inference backend by setting: engine=\"transformers\"…",
  "external_url": "https://huggingface.co/blog/PaddlePaddle/paddleocr-transformers",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/huggingface-co/2026/05/2026-05-18-paddleocr-3-5-running-ocr-and-document-parsing-tasks-with-a.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/huggingface-co/2026/05/2026-05-18-paddleocr-3-5-running-ocr-and-document-parsing-tasks-with-a.md"
  },
  "id": "urn:aggr:item:8e9ce9fbfca153d47d777a3fec95c89fae8850aa",
  "isBasedOn": {
    "@id": "https://huggingface.co/blog/PaddlePaddle/paddleocr-transformers"
  },
  "mainEntity": {
    "@id": "https://huggingface.co/blog/PaddlePaddle/paddleocr-transformers",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-05-18-paddleocr-3-5-running-ocr-and-document-parsing-tasks-with-a/#webpage"
    },
    "dateModified": "2026-05-18T15:12:46+00:00",
    "datePublished": "2026-05-18T15:12:46+00:00",
    "headline": "PaddleOCR 3.5: Running OCR and Document Parsing Tasks with a Transformers Backend",
    "image": {
      "@type": "ImageObject",
      "caption": null,
      "height": 90,
      "url": "https://cdn-uploads.huggingface.co/production/uploads/652b2e9166313ebb6197e706/Bl-qDWU9OfuXZ06hNxZE7.jpeg",
      "width": 160
    },
    "timeRequired": "PT4M",
    "url": "https://huggingface.co/blog/PaddlePaddle/paddleocr-transformers",
    "wordCount": 887
  },
  "name": "Archived snapshot: PaddleOCR 3.5: Running OCR and Document Parsing Tasks with a Transformers Backend",
  "preview": {
    "alt": null,
    "color": null,
    "height": 90,
    "placeholder": {
      "data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
      "hash": ""
    },
    "url": "https://cdn-uploads.huggingface.co/production/uploads/652b2e9166313ebb6197e706/Bl-qDWU9OfuXZ06hNxZE7.jpeg",
    "width": 160
  },
  "reading_minutes": 4,
  "replicated_at": null,
  "source": "huggingface-co",
  "source_name": "Hugging Face - Blog",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-10-19T01:26:53.998049939+00:00",
  "title": "PaddleOCR 3.5: Running OCR and Document Parsing Tasks with a Transformers Backend",
  "url": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-05-18-paddleocr-3-5-running-ocr-and-document-parsing-tasks-with-a/",
  "word_count": 887
}