Instructions to use tencent/Youtu-Parsing with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Youtu-Parsing with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tencent/Youtu-Parsing", 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)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("tencent/Youtu-Parsing", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Youtu-Parsing with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Youtu-Parsing" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/Youtu-Parsing", "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/tencent/Youtu-Parsing
- SGLang
How to use tencent/Youtu-Parsing 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 "tencent/Youtu-Parsing" \ --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": "tencent/Youtu-Parsing", "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 "tencent/Youtu-Parsing" \ --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": "tencent/Youtu-Parsing", "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 tencent/Youtu-Parsing with Docker Model Runner:
docker model run hf.co/tencent/Youtu-Parsing
Commit Β·
0d8c591
1
Parent(s): c13c3aa
docs: Update README and refresh asset images
Browse files- README.md +1 -14
- assets/art.png +2 -2
- assets/chart.png +2 -2
- assets/chart2.png +2 -2
- assets/formula.png +2 -2
- assets/handwriting.png +2 -2
- assets/hierarchical.png +0 -3
- assets/hierarchical2.png +0 -3
- assets/printed.png +2 -2
- assets/seal.png +0 -3
- assets/wired.png +2 -2
- assets/wireless.png +2 -2
README.md
CHANGED
|
@@ -11,7 +11,7 @@ base_model_relation: finetune
|
|
| 11 |
|
| 12 |
# <img src="assets/youtu-parsing-logo.png" alt="Youtu-Parsing Logo" height="100px">
|
| 13 |
|
| 14 |
-
[π License](https://huggingface.co/tencent/Youtu-Parsing/blob/main/LICENSE.txt) β’ [π» Code](https://github.com/TencentCloudADP/youtu-parsing) β’ [π Benchmarks](#benchmarks) β’ [π Getting Started](#quickstart)
|
| 15 |
|
| 16 |
</div>
|
| 17 |
|
|
@@ -128,19 +128,6 @@ parser.parse_file(input_path=image_path, output_dir=output_dir)
|
|
| 128 |
<img src="./assets/chart2.png" width="800"/>
|
| 129 |
</div>
|
| 130 |
|
| 131 |
-
### Seal Recognition
|
| 132 |
-
<div align="center">
|
| 133 |
-
<img src="./assets/seal.png" width="800"/>
|
| 134 |
-
</div>
|
| 135 |
-
|
| 136 |
-
### Hierarchical Structure Analysis
|
| 137 |
-
<div align="center">
|
| 138 |
-
<img src="./assets/hierarchical.png" width="800"/>
|
| 139 |
-
</div>
|
| 140 |
-
|
| 141 |
-
<div align="center">
|
| 142 |
-
<img src="./assets/hierarchical2.png" width="800"/>
|
| 143 |
-
</div>
|
| 144 |
|
| 145 |
## π€ Acknowledgements
|
| 146 |
We would like to thank [Youtu-LLM](https://github.com/TencentCloudADP/youtu-tip/tree/master/youtu-llm), [OmniDocBench](https://github.com/opendatalab/OmniDocBench), [olmOCR](https://github.com/allenai/olmocr), [dots.ocr](https://github.com/rednote-hilab/dots.ocr), [MinerU](https://github.com/opendatalab/MinerU), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [PSENet](https://github.com/whai362/PSENet) for providing model weights, benchmarks and valuable code. We also appreciate everyone's contribution to this open-source project!
|
|
|
|
| 11 |
|
| 12 |
# <img src="assets/youtu-parsing-logo.png" alt="Youtu-Parsing Logo" height="100px">
|
| 13 |
|
| 14 |
+
[π License](https://huggingface.co/tencent/Youtu-Parsing/blob/main/LICENSE.txt) β’ [π¨βπ» Code](https://github.com/TencentCloudADP/youtu-parsing) β’ [π₯οΈ Demo](https://huggingface.co/spaces/Tencent/Youtu-Parsing) β’ [π Benchmarks](#benchmarks) β’ [π Getting Started](#quickstart)
|
| 15 |
|
| 16 |
</div>
|
| 17 |
|
|
|
|
| 128 |
<img src="./assets/chart2.png" width="800"/>
|
| 129 |
</div>
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
## π€ Acknowledgements
|
| 133 |
We would like to thank [Youtu-LLM](https://github.com/TencentCloudADP/youtu-tip/tree/master/youtu-llm), [OmniDocBench](https://github.com/opendatalab/OmniDocBench), [olmOCR](https://github.com/allenai/olmocr), [dots.ocr](https://github.com/rednote-hilab/dots.ocr), [MinerU](https://github.com/opendatalab/MinerU), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [PSENet](https://github.com/whai362/PSENet) for providing model weights, benchmarks and valuable code. We also appreciate everyone's contribution to this open-source project!
|
assets/art.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/chart.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/chart2.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/formula.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/handwriting.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/hierarchical.png
DELETED
Git LFS Details
|
assets/hierarchical2.png
DELETED
Git LFS Details
|
assets/printed.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/seal.png
DELETED
Git LFS Details
|
assets/wired.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/wireless.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|