Image-Text-to-Text
Transformers
Safetensors
paddleocr_vl
ocr
compressed-tensors
vllm
quantized
fp8
conversational
custom_code
Eval Results
Instructions to use axteam/PaddleOCR-VL-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axteam/PaddleOCR-VL-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="axteam/PaddleOCR-VL-FP8-dynamic", 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("axteam/PaddleOCR-VL-FP8-dynamic", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("axteam/PaddleOCR-VL-FP8-dynamic", trust_remote_code=True, device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use axteam/PaddleOCR-VL-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axteam/PaddleOCR-VL-FP8-dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "axteam/PaddleOCR-VL-FP8-dynamic", "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/axteam/PaddleOCR-VL-FP8-dynamic
- SGLang
How to use axteam/PaddleOCR-VL-FP8-dynamic 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 "axteam/PaddleOCR-VL-FP8-dynamic" \ --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": "axteam/PaddleOCR-VL-FP8-dynamic", "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 "axteam/PaddleOCR-VL-FP8-dynamic" \ --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": "axteam/PaddleOCR-VL-FP8-dynamic", "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 axteam/PaddleOCR-VL-FP8-dynamic with Docker Model Runner:
docker model run hf.co/axteam/PaddleOCR-VL-FP8-dynamic
Download PP-DocLayoutV2/config.json from axteam/PaddleOCR-VL-FP8-dynamic: direct link, hf CLI and curl.
- Browser
- Download file 4.54 kB
-
https://huggingface.co/axteam/PaddleOCR-VL-FP8-dynamic/resolve/main/PP-DocLayoutV2/config.json
- Command line
-
hf download hf://axteam/PaddleOCR-VL-FP8-dynamic/PP-DocLayoutV2/config.json
-
curl -L -o config.json https://huggingface.co/axteam/PaddleOCR-VL-FP8-dynamic/resolve/main/PP-DocLayoutV2/config.json
4.54 kB
| { | |
| "mode": "paddle", | |
| "draw_threshold": 0.5, | |
| "metric": "COCO", | |
| "use_dynamic_shape": false, | |
| "Global": { | |
| "model_name": "PP-DocLayoutV2" | |
| }, | |
| "arch": "DETR", | |
| "min_subgraph_size": 3, | |
| "Preprocess": [ | |
| { | |
| "interp": 2, | |
| "keep_ratio": false, | |
| "target_size": [ | |
| 800, | |
| 800 | |
| ], | |
| "type": "Resize" | |
| }, | |
| { | |
| "mean": [ | |
| 0.0, | |
| 0.0, | |
| 0.0 | |
| ], | |
| "norm_type": "none", | |
| "std": [ | |
| 1.0, | |
| 1.0, | |
| 1.0 | |
| ], | |
| "type": "NormalizeImage" | |
| }, | |
| { | |
| "type": "Permute" | |
| } | |
| ], | |
| "label_list": [ | |
| "abstract", | |
| "algorithm", | |
| "aside_text", | |
| "chart", | |
| "content", | |
| "display_formula", | |
| "doc_title", | |
| "figure_title", | |
| "footer", | |
| "footer_image", | |
| "footnote", | |
| "formula_number", | |
| "header", | |
| "header_image", | |
| "image", | |
| "inline_formula", | |
| "number", | |
| "paragraph_title", | |
| "reference", | |
| "reference_content", | |
| "seal", | |
| "table", | |
| "text", | |
| "vertical_text", | |
| "vision_footnote" | |
| ], | |
| "Hpi": { | |
| "backend_configs": { | |
| "paddle_infer": { | |
| "trt_dynamic_shapes": { | |
| "image": [ | |
| [ | |
| 1, | |
| 3, | |
| 800, | |
| 800 | |
| ], | |
| [ | |
| 1, | |
| 3, | |
| 800, | |
| 800 | |
| ], | |
| [ | |
| 8, | |
| 3, | |
| 800, | |
| 800 | |
| ] | |
| ], | |
| "scale_factor": [ | |
| [ | |
| 1, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 2 | |
| ], | |
| [ | |
| 8, | |
| 2 | |
| ] | |
| ] | |
| }, | |
| "trt_dynamic_shape_input_data": { | |
| "scale_factor": [ | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 1 | |
| ], | |
| [ | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67, | |
| 0.67 | |
| ] | |
| ] | |
| } | |
| }, | |
| "tensorrt": { | |
| "dynamic_shapes": { | |
| "image": [ | |
| [ | |
| 1, | |
| 3, | |
| 800, | |
| 800 | |
| ], | |
| [ | |
| 1, | |
| 3, | |
| 800, | |
| 800 | |
| ], | |
| [ | |
| 8, | |
| 3, | |
| 800, | |
| 800 | |
| ] | |
| ], | |
| "scale_factor": [ | |
| [ | |
| 1, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 2 | |
| ], | |
| [ | |
| 8, | |
| 2 | |
| ] | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } |