Image-Text-to-Text
PaddleOCR
Safetensors
English
Chinese
multilingual
paddleocr_vl
ERNIE4.5
PaddlePaddle
image-to-text
ocr
document-parse
layout
table
formula
chart
seal
spotting
conversational
custom_code
Eval Results
Instructions to use PaddlePaddle/PaddleOCR-VL-1.8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use PaddlePaddle/PaddleOCR-VL-1.8 with PaddleOCR:
# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation from paddleocr import PaddleOCRVL pipeline = PaddleOCRVL(pipeline_version="v1.8") output = pipeline.predict("path/to/document_image.png") for res in output: res.print() res.save_to_json(save_path="output") res.save_to_markdown(save_path="output") - Notebooks
- Google Colab
- Kaggle
Sync modeling_paddleocr_vl.py with PaddleOCR-VL-1.6 (transformers v5 support)
#1
by Bvicii - opened
Replace modeling_paddleocr_vl.py with the latest version from PaddleOCR-VL-1.6. The architecture is identical; configuration_paddleocr_vl.py, processing/image_processing code and processor configs already match 1.6 byte-for-byte, so only this file changes.
Main changes (transformers v5 support, 4.x still works):
- Import
merge_with_config_defaultsascheck_model_inputson transformers >= 5.2, fall back to the old name otherwise. - Wrap
create_causal_maskto handle its signature changes (input_embeds->inputs_embeds,cache_positionremoved) and pass 4D masks through. - Compute default RoPE locally (no longer in
ROPE_INIT_FUNCTIONSin v5) and initialize non-persistent buffers (inv_freq,position_ids) in_init_weights. - Route weight init through
transformers.initializationwhen available and skip tensors already loaded from the checkpoint. _tied_weights_keysas a dict;_supports_flash_attnflag.- Vision attention: attend per image when
cu_seqlenspacks several images (non-flash path). prepare_inputs_for_generation: readcache_positioncreated by the v5 parent; droppixel_valuesonly once the KV cache holds tokens.
š¤ Generated with Claude Code
Co-Authored-By: Claude Code noreply@anthropic.com
Bvicii changed pull request status to merged
Bvicii deleted the
refs/pr/1 ref