Commit 4c24053d authored by chenych's avatar chenych
Browse files

Update README

parent 92a367a9
......@@ -18,13 +18,13 @@ PaddleOCR-VL 将复杂的文档解析任务分解为两个阶段。第一阶段
### 硬件需求
DCU型号:K100AI,节点数量:1台,卡数:1张。
`-v 路径``docker_name`根据实际情况修改
`-v 挂载路径``docker_name`根据实际情况修改
### Docker(方法一)
```bash
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:vllm0.9.2-ubuntu22.04-dtk25.04.2-py3.10-paddleocr-vl
docker run -it --shm-size 200g --network=host --name {docker_name} --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mkfd --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.2-py3.10 bash
docker run -it --shm-size 200g --network=host --name {docker_name} --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mkfd --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro image.sourcefind.cn:5000/dcu/admin/base/custom:vllm0.9.2-ubuntu22.04-dtk25.04.2-py3.10-paddleocr-vl bash
cd /your_code_path/paddleocr-vl_paddle
```
......@@ -34,7 +34,7 @@ cd /your_code_path/paddleocr-vl_paddle
cd docker
docker build --no-cache -t paddleocr-vl:latest .
docker run -it --shm-size 200g --network=host --name {docker_name} --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mkfd --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.2-py3.10 bash
docker run -it --shm-size 200g --network=host --name {docker_name} --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mkfd --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro image.sourcefind.cn:5000/dcu/admin/base/custom:vllm0.9.2-ubuntu22.04-dtk25.04.2-py3.10-paddleocr-vl bash
cd /your_code_path/paddleocr-vl_paddle
```
......@@ -71,7 +71,7 @@ paddleocr doc_parser -i ./doc/paddleocr_vl_demo.png --device DCU --precision fp3
### vllm
serve端
```bash
export PADDLE_PDX_DISABLE_DEV_MODEL_WL=true
export PADDLE_PDX_DISABLE_DEV_MODEL_WL=1
vllm serve PaddlePaddle/PaddleOCR-VL --trust-remote-code --max-model-len 16384 --max-num-batched-tokens 16384 --gpu-memory-utilization 0.8 --served-model-name PaddleOCR-VL-0.9B
```
......@@ -113,7 +113,7 @@ OCR
- [PaddleOCR-VL](https://huggingface.co/PaddlePaddle/PaddleOCR-VL)
## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/deepseek-ocr_pytorch
- https://developer.sourcefind.cn/codes/modelzoo/paddleocr-vl_paddle
## 参考资料
- https://github.com/PaddlePaddle/PaddleOCR
......
......@@ -7,5 +7,5 @@ pipeline = PaddleOCRVL(device='DCU')
output = pipeline.predict("./doc/paddleocr_vl_demo.png")
for res in output:
res.print() ## 打印预测的结构化输出
res.save_to_json(save_path="output") ## 保存当前图像的结构化json结果
res.save_to_markdown(save_path="output") ## 保存当前图像的markdown格式的结果
res.save_to_json(save_path="output-jpg") ## 保存当前图像的结构化json结果
res.save_to_markdown(save_path="output-jpg") ## 保存当前图像的markdown格式的结果
from pathlib import Path
from paddleocr import PaddleOCRVL
input_file = "./your_pdf_file.pdf"
output_path = Path("./output")
input_file = "./doc/PaddleOCR-VL.pdf"
output_path = Path("./output-pdf")
pipeline = PaddleOCRVL(device='DCU')
output = pipeline.predict(input=input_file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment