Skip to content

Commit a9e4850

Browse files
committed
q
2 parents 4182ef1 + f254f0e commit a9e4850

File tree

283 files changed

+24088
-796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+24088
-796
lines changed

.github/workflows/deploy_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Develop Docs
22
on:
33
push:
44
branches: #设置更新哪个分支会更新站点
5-
- release/3.2
5+
- release/3.3
66
permissions:
77
contents: write
88
jobs:
@@ -27,5 +27,5 @@ jobs:
2727
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-static-i18n mkdocs-minify-plugin
2828
- run: |
2929
git fetch origin gh-pages --depth=1
30-
mike deploy --push --update-aliases 3.2 latest
30+
mike deploy --push --update-aliases 3.3 latest
3131
mike set-default --push latest

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repos:
5555
- id: isort
5656
args:
5757
- --profile=black
58-
exclude: ^deploy/ultra-infer/python/ultra_infer/
58+
files: ^paddlex/
5959

6060
# check license
6161
- repo: local

.precommit/check_imports.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@
2424
from stdlib_list import stdlib_list
2525

2626
sys.path.append(str(pathlib.Path(__file__).parent.parent))
27-
from setup import DEP_SPECS, REQUIRED_DEPS
27+
from setup import REQUIRED_DEPS
2828

2929
# NOTE: We do not use `importlib.metadata.packages_distributions` here because
3030
# 1. It is supported only in Python 3.10+.
3131
# 2. It requires the packages to be installed, but we are doing a static check.
3232
MOD_TO_DEP = {
33-
"aistudio_sdk": "aistudio_sdk",
33+
"aistudio_sdk": "aistudio-sdk",
3434
"aiohttp": "aiohttp",
3535
"baidubce": "bce-python-sdk",
3636
"bs4": "beautifulsoup4",
37+
"docx": "python-docx",
3738
"chardet": "chardet",
3839
"chinese_calendar": "chinese-calendar",
3940
"colorlog": "colorlog",
@@ -43,9 +44,10 @@
4344
"fastapi": "fastapi",
4445
"filelock": "filelock",
4546
"filetype": "filetype",
47+
"flash_attn": "flash-attn",
4648
"ftfy": "ftfy",
4749
"GPUtil": "GPUtil",
48-
"huggingface_hub": "huggingface_hub",
50+
"huggingface_hub": "huggingface-hub",
4951
"imagesize": "imagesize",
5052
"jinja2": "Jinja2",
5153
"joblib": "joblib",
@@ -61,6 +63,7 @@
6163
"cv2": "opencv-contrib-python",
6264
"openpyxl": "openpyxl",
6365
"packaging": "packaging",
66+
"paddle2onnx": "paddle2onnx",
6467
"pandas": "pandas",
6568
"PIL": "pillow",
6669
"premailer": "premailer",
@@ -74,22 +77,28 @@
7477
"regex": "regex",
7578
"requests": "requests",
7679
"ruamel.yaml": "ruamel.yaml",
80+
"safetensors": "safetensors",
7781
"skimage": "scikit-image",
7882
"sklearn": "scikit-learn",
83+
"sentencepiece": "sentencepiece",
84+
"sglang": "sglang",
7985
"shapely": "shapely",
8086
"soundfile": "soundfile",
8187
"starlette": "starlette",
8288
"tiktoken": "tiktoken",
8389
"tokenizers": "tokenizers",
90+
"torch": "torch",
8491
"tqdm": "tqdm",
92+
"transformers": "transformers",
8593
"typing_extensions": "typing-extensions",
8694
"ujson": "ujson",
8795
"uvicorn": "uvicorn",
96+
"uvloop": "uvloop",
97+
"vllm": "vllm",
98+
"xformers": "xformers",
8899
"yarl": "yarl",
100+
"bidi": "python-bidi",
89101
}
90-
assert (
91-
set(MOD_TO_DEP.values()) == DEP_SPECS.keys()
92-
), f"`MOD_TO_DEP` should be updated to match `DEP_SPECS`. Symmetric difference: {set(MOD_TO_DEP.values()) ^ DEP_SPECS.keys()}"
93102
MOD_PATTERN = re.compile(
94103
rf"^(?:{'|'.join([re.escape(mod) for mod in MOD_TO_DEP])})(?=\.|$)"
95104
)
@@ -107,7 +116,11 @@
107116
"paddle3d",
108117
"paddlevideo",
109118
}
110-
MANUALLY_MANAGED_OPTIONAL_HEAVY_MODS = {"paddle_custom_device", "ultra_infer"}
119+
MANUALLY_MANAGED_OPTIONAL_HEAVY_MODS = {
120+
"paddle_custom_device",
121+
"ultra_infer",
122+
"fastdeploy",
123+
}
111124

112125

113126
def check(file_path):

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ PaddleX 3.0 是基于飞桨框架构建的低代码开发工具,它集成了
3535

3636
## 📣 近期更新
3737

38+
🔥🔥 **2025.10.16,发布 PaddleX v3.3.0**,新增能力如下:
39+
40+
- **支持PaddleOCR-VL、PP-OCRv5多语种模型的推理部署能力。**
41+
3842
🔥🔥 **2025.8.20,发布 PaddleX v3.2.0**,新增能力如下:
3943

4044
- **部署能力升级:**

README_en.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ PaddleX 3.0 is a low-code development tool for AI models built on the PaddlePadd
3737

3838
## 📣 Recent Updates
3939

40+
🔥🔥 **2025.10.16, PaddleX v3.3.0 Released**
41+
42+
- **Added support for inference and deployment of PaddleOCR-VL and PP-OCRv5 multilingual models.**
43+
4044
🔥🔥 **2025.8.20, PaddleX v3.2.0 Released**
4145

4246
- **Deployment Capability Upgrades:**
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from paddlex import create_pipeline
16+
17+
pipeline = create_pipeline(pipeline="PaddleOCR-VL")
18+
19+
output = pipeline.predict(
20+
"/paddle/project/PaddleX/demo_paper.png",
21+
use_doc_orientation_classify=False,
22+
use_doc_unwarping=False,
23+
)
24+
25+
for res in output:
26+
res.print()
27+
res.save_to_img("./output")
28+
res.save_to_json("./output")
29+
res.save_to_xlsx("./output")
30+
res.save_to_html("./output")
31+
res.save_to_markdown("./output", pretty=False)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.10
2+
3+
RUN apt-get update \
4+
&& apt-get install -y libgl1 \
5+
&& rm -rf /var/lib/apt/lists/*
6+
7+
ENV PIP_NO_CACHE_DIR=0
8+
ENV PYTHONUNBUFFERED=1
9+
ENV PYTHONDONTWRITEBYTECODE=1
10+
11+
ARG PADDLEX_VERSION=">=3.3.6,<3.4"
12+
RUN python -m pip install "paddlex${PADDLEX_VERSION}"
13+
14+
ARG BUILD_FOR_SM120=false
15+
RUN if [ "${BUILD_FOR_SM120}" = 'true' ]; then \
16+
python -m pip install torch==2.8.0 https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.4.11/flash_attn-2.8.3%2Bcu128torch2.8-cp310-cp310-linux_x86_64.whl; \
17+
else \
18+
python -m pip install torch==2.8.0 https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.3.14/flash_attn-2.8.2+cu128torch2.8-cp310-cp310-linux_x86_64.whl; \
19+
fi \
20+
&& paddlex --install genai-vllm-server
21+
22+
EXPOSE 8080
23+
24+
CMD ["paddlex_genai_server", "--model_name", "PaddleOCR-VL-0.9B", "--host", "0.0.0.0", "--port", "8080", "--backend", "vllm"]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
paddlex_version='>=3.3.6,<3.4'
4+
build_for_sm120='false'
5+
tag_suffix='latest'
6+
7+
while [[ $# -gt 0 ]]; do
8+
case $1 in
9+
--pdx-version)
10+
paddlex_version="==$2"
11+
shift
12+
shift
13+
;;
14+
--sm120)
15+
build_for_sm120='true'
16+
shift
17+
;;
18+
--tag-suffix)
19+
tag_suffix="$2"
20+
shift
21+
shift
22+
;;
23+
*)
24+
echo "Unknown option: $1" >&2
25+
exit 2
26+
;;
27+
esac
28+
done
29+
30+
docker build \
31+
-t "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddlex-genai-vllm-server:${tag_suffix}" \
32+
--build-arg PADDLEX_VERSION="${paddlex_version}" \
33+
--build-arg BUILD_FOR_SM120="${build_for_sm120}" \
34+
--build-arg http_proxy="${http_proxy}" \
35+
--build-arg https_proxy="${https_proxy}" \
36+
--build-arg no_proxy="${no_proxy}" \
37+
.

deploy/hps/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ comments: true
1010

1111
**请注意,本项目依赖于如下环境配置:**
1212

13+
- **CPU 架构**:x86-64
1314
- **操作系统**:Linux
14-
- **Docker 版本**`>= 20.10.0`,用于镜像构建和部署
15-
- **CPU 架构**:x86-64
15+
- **Docker Engine 版本**`>= 20.10.0`,用于镜像构建和部署
1616

1717
本文档主要介绍如何基于本项目提供的脚本完成高稳定性服务化部署环境搭建与物料打包。整体流程分为两个阶段:
1818

@@ -48,7 +48,7 @@ comments: true
4848
为了使构建结果的可重现性更强,本步骤将依赖锁定到精确版本。请切换至 `server_env` 目录执行如下脚本:
4949

5050
```bash
51-
./script/freeze_requirements.sh
51+
./scripts/freeze_requirements.sh
5252
```
5353

5454
该脚本调用 `pip-tools compile` 解析依赖源文件,并最终生成一系列 `.txt` 文件(如 `requirements/gpu.txt``requirements/cpu.txt` 等),这些文件将为 [1.3 镜像构建](./README.md#13-镜像构建) 提供依赖版本约束。
@@ -85,7 +85,7 @@ comments: true
8585
对于 Triton Server,项目使用预先编译好的版本,将在构建镜像时自动下载,无需手动下载。以构建 GPU 镜像为例,在 `server_env` 目录下执行以下命令:
8686

8787
```bash
88-
./scripts/build_deployment_image.sh -k gpu -t latest-gpu
88+
./scripts/build_deployment_image.sh -k gpu -t latest-gpu
8989
```
9090

9191
构建镜像的参数配置项包括
@@ -118,10 +118,10 @@ comments: true
118118
执行成功后,命令行会输出以下提示信息:
119119

120120
```text
121-
=> => exporting to image
122-
=> => exporting layers
123-
=> => writing image sha256:ba3d0b2b079d63ee0239a99043fec7e25f17bf2a7772ec2fc80503c1582b3459
124-
=> => naming to ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/hps:latest-gpu
121+
=> => exporting to image
122+
=> => exporting layers
123+
=> => writing image sha256:ba3d0b2b079d63ee0239a99043fec7e25f17bf2a7772ec2fc80503c1582b3459
124+
=> => naming to ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/hps:latest-gpu
125125
```
126126

127127
如需批量构建 GPU 和 CPU 镜像,可以执行以下命令:
@@ -172,7 +172,7 @@ comments: true
172172
</tbody>
173173
</table>
174174

175-
调用后存储到当前目录 `/output` 路径下。
175+
调用后存储到当前目录 `output` 路径下。
176176

177177
## 3.FAQ
178178

deploy/hps/README_en.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ This project provides a high-stability serving solution, consisting of two main
1111

1212
**Note: This project relies on the following environment configurations:**
1313

14-
- **Operating System**: Linux
15-
- **Docker Version**: `>= 20.10.0` (Used for image building and deployment)
1614
- **CPU Architecture**: x86-64
15+
- **Operating System**: Linux
16+
- **Docker Engine Version**: `>= 20.10.0` (Used for image building and deployment)
1717

1818
This document mainly introduces how to set up a high stability serving environment and package related materials using the scripts provided by this project. The overall process consists of two main stages:
1919

@@ -32,13 +32,13 @@ Image Building Steps:
3232

3333
1. Build a requirement collection image. (Optional)
3434
2. Freeze requirement versions to improve the reproducibility of deployment image building. (Optional)
35-
3. Build the deployment image based on the frozen requirement information to generate the final deployment image and provide image support for subsequent pipeline execution.
35+
3. Build the deployment image based on the frozen requirement information to generate the final deployment image and provide image support for subsequent pipeline execution.
3636

3737
**If you do not need to modify requirement-related information, you can skip to [1.3 Building Image](./README_en.md#13-building-image) to build the deployment image using cached requirement information.**
3838

3939
## 1.1 Build the Requirement Collection Image (Optional)
4040

41-
Navigate to the `server_env` directory and run follow script for building the requirement collection image in this directory.
41+
Navigate to the `server_env` directory and run follow script for building the requirement collection image in this directory.
4242

4343
```bash
4444
./scripts/prepare_rc_image.sh
@@ -121,10 +121,10 @@ If the basic image cannot be pulled, please refer to the solutions in the [FAQ](
121121
After run successfully, the command line will display the following message:
122122

123123
```text
124-
=> => exporting to image
125-
=> => exporting layers
126-
=> => writing image sha256:ba3d0b2b079d63ee0239a99043fec7e25f17bf2a7772ec2fc80503c1582b3459
127-
=> => naming to ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/hps:latest-gpu
124+
=> => exporting to image
125+
=> => exporting layers
126+
=> => writing image sha256:ba3d0b2b079d63ee0239a99043fec7e25f17bf2a7772ec2fc80503c1582b3459
127+
=> => naming to ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/hps:latest-gpu
128128
```
129129

130130
To build both GPU and CPU images run the following command:
@@ -140,7 +140,7 @@ This stage mainly introduces how to package pipeline materials. This function is
140140
- `client`: Responsible for invoking the model services.
141141
- `server`: Deployed using the images built in [1. Image Building](./README_en.md#1-image-building), serving as the runtime environment for model services.
142142

143-
Before packaging the pipeline materials, you need to switch to the `sdk` directory and run the `scripts/assemble.sh` script in this directory for packaging. For example, to package the general OCR pipeline, run:
143+
Before packaging the pipeline materials, you need to switch to the `sdk` directory and run the `scripts/assemble.sh` script in this directory for packaging. For example, to package the general OCR pipeline, run:
144144

145145
```bash
146146
./scripts/assemble.sh OCR
@@ -175,7 +175,7 @@ The parameters for the packaging script are described as follows:
175175
</tbody>
176176
</table>
177177

178-
After run successfully, the packaged will be stored in the `/output` directory.
178+
After run successfully, the packaged will be stored in the `output` directory.
179179

180180
## 3. FAQ
181181

@@ -191,4 +191,4 @@ When running the image build scripts, you can use the `-p` parameter to specify
191191

192192
```bash
193193
./scripts/prepare_rc_image.sh -p https://pypi.tuna.tsinghua.edu.cn/simple
194-
```
194+
```

0 commit comments

Comments
 (0)