Image-Text-to-Text
Transformers
Safetensors
English
Chinese
multilingual
qwen3_5
ocr
pdf
document-parsing
document-understanding
layout-analysis
table-recognition
chart-parsing
formula-recognition
chemical-formula
markdown
vision-language
infinity-parser
infinity_parser2
conversational
Eval Results
Instructions to use infly/Infinity-Parser2-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use infly/Infinity-Parser2-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="infly/Infinity-Parser2-Flash") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("infly/Infinity-Parser2-Flash") model = AutoModelForMultimodalLM.from_pretrained("infly/Infinity-Parser2-Flash") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use infly/Infinity-Parser2-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "infly/Infinity-Parser2-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "infly/Infinity-Parser2-Flash", "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/infly/Infinity-Parser2-Flash
- SGLang
How to use infly/Infinity-Parser2-Flash 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 "infly/Infinity-Parser2-Flash" \ --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": "infly/Infinity-Parser2-Flash", "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 "infly/Infinity-Parser2-Flash" \ --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": "infly/Infinity-Parser2-Flash", "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 infly/Infinity-Parser2-Flash with Docker Model Runner:
docker model run hf.co/infly/Infinity-Parser2-Flash
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
| 1 |
-
--
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Infinity-Parser2-2B
|
| 2 |
+
|
| 3 |
+
<p align="center">
|
| 4 |
+
<img src="assets/logo.png" width="400"/>
|
| 5 |
+
<p>
|
| 6 |
+
|
| 7 |
+
<p align="center">
|
| 8 |
+
💻 <a href="https://github.com/infly-ai/INF-MLLM">Github</a> |
|
| 9 |
+
📊 <a href="https://huggingface.co/datasets/infly/Infinity-Doc2-xxx">Dataset</a> |
|
| 10 |
+
📄 <a>Paper (coming soon...)</a> |
|
| 11 |
+
🚀 <a>Demo (coming soon...)</a>
|
| 12 |
+
</p>
|
| 13 |
+
|
| 14 |
+
# Introduction
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
## Key Features
|
| 18 |
+
|
| 19 |
+
# Architecture
|
| 20 |
+
|
| 21 |
+
todo
|
| 22 |
+
|
| 23 |
+
# Performance
|
| 24 |
+
|
| 25 |
+
## Document Parsing
|
| 26 |
+

|
| 27 |
+
|
| 28 |
+
## Table Parsing
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
## Math Formula Parsing
|
| 32 |
+

|
| 33 |
+
|
| 34 |
+
## Chart Parsing
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
## Chemical Formula Parsing
|
| 38 |
+

|
| 39 |
+
|
| 40 |
+
## General Multimodal Understanding
|
| 41 |
+

|
| 42 |
+
|
| 43 |
+
# Quick Start
|
| 44 |
+
|
| 45 |
+
todo
|
| 46 |
+
|
| 47 |
+
# Visualization
|
| 48 |
+
|
| 49 |
+
## Comparison Examples
|
| 50 |
+

|
| 51 |
+
|
| 52 |
+
# Limitation & Future Work
|
| 53 |
+
|
| 54 |
+
## Limitations
|
| 55 |
+
|
| 56 |
+
## Future Work
|
| 57 |
+
|
| 58 |
+
# Acknowledgments
|
| 59 |
+
We would like to thank [Qwen3-VL](https://github.com/QwenLM/Qwen3-VL), [ms-swift](https://github.com/modelscope/ms-swift), [verl](https://github.com/verl-project/verl), [olmOCR-bench](https://huggingface.co/datasets/allenai/olmOCR-bench) and [OmniDocBench](https://github.com/opendatalab/OmniDocBench) for providing data, code and models.
|
| 60 |
+
|
| 61 |
+
# Citation
|
| 62 |
+
|
| 63 |
+
Coming soon...
|
| 64 |
+
|
| 65 |
+
# License
|
| 66 |
+
|
| 67 |
+
This model is licensed under apache-2.0.
|