Jelajahi Sumber

[Fix] Fix high-performance serving bugs (#4482)

* Fix hps bug

* Update deps

* Fix doc

* Fix doc
Lin Manhui 2 bulan lalu
induk
melakukan
33a2d6b1aa

+ 4 - 4
deploy/hps/README.md

@@ -10,9 +10,9 @@ comments: true
 
 **请注意,本项目依赖于如下环境配置:**
 
-- **操作系统**:Linux
-- **Docker 版本**:`>= 20.10.0`,用于镜像构建和部署
 - **CPU 架构**:x86-64
+- **操作系统**:Linux
+- **Docker Engine 版本**:`>= 20.10.0`,用于镜像构建和部署
 
 本文档主要介绍如何基于本项目提供的脚本完成高稳定性服务化部署环境搭建与物料打包。整体流程分为两个阶段:
 
@@ -48,7 +48,7 @@ comments: true
 为了使构建结果的可重现性更强,本步骤将依赖锁定到精确版本。请切换至 `server_env` 目录执行如下脚本:
 
 ```bash
-./script/freeze_requirements.sh
+./scripts/freeze_requirements.sh
 ```
 
 该脚本调用 `pip-tools compile` 解析依赖源文件,并最终生成一系列 `.txt` 文件(如 `requirements/gpu.txt`、`requirements/cpu.txt` 等),这些文件将为 [1.3 镜像构建](./README.md#13-镜像构建) 提供依赖版本约束。
@@ -172,7 +172,7 @@ comments: true
 </tbody>
 </table>
 
-调用后存储到当前目录 `/output` 路径下。
+调用后存储到当前目录 `output` 路径下。
 
 ## 3.FAQ
 

+ 4 - 4
deploy/hps/README_en.md

@@ -11,9 +11,9 @@ This project provides a high-stability serving solution, consisting of two main
 
 **Note: This project relies on the following environment configurations:**
 
-- **Operating System**: Linux
-- **Docker Version**: `>= 20.10.0` (Used for image building and deployment)
 - **CPU Architecture**: x86-64
+- **Operating System**: Linux
+- **Docker Engine Version**: `>= 20.10.0` (Used for image building and deployment)
 
 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:
 
@@ -140,7 +140,7 @@ This stage mainly introduces how to package pipeline materials. This function is
 - `client`: Responsible for invoking the model services.
 - `server`: Deployed using the images built in [1. Image Building](./README_en.md#1-image-building), serving as the runtime environment for model services.
 
-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:
+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:
 
 ```bash
 ./scripts/assemble.sh OCR
@@ -175,7 +175,7 @@ The parameters for the packaging script are described as follows:
 </tbody>
 </table>
 
-After run successfully, the packaged  will be stored in the `/output` directory.
+After run successfully, the packaged  will be stored in the `output` directory.
 
 ## 3. FAQ
 

+ 25 - 4
deploy/hps/server_env/requirements/cpu.txt

@@ -13,6 +13,8 @@ aiohttp==3.11.12
     #   paddlex (../../../setup.py)
 aiosignal==1.3.2
     # via aiohttp
+aistudio-sdk==0.3.5
+    # via paddlex (../../../setup.py)
 annotated-types==0.7.0
     # via pydantic
 anyio==4.8.0
@@ -27,7 +29,9 @@ async-timeout==4.0.3
 attrs==25.1.0
     # via aiohttp
 bce-python-sdk==0.9.29
-    # via paddlex (../../../setup.py)
+    # via
+    #   aistudio-sdk
+    #   paddlex (../../../setup.py)
 beautifulsoup4==4.13.4
     # via paddlex (../../../setup.py)
 cachetools==5.5.2
@@ -46,7 +50,9 @@ charset-normalizer==3.4.1
 chinese-calendar==1.10.0
     # via paddlex (../../../setup.py)
 click==8.1.8
-    # via uvicorn
+    # via
+    #   aistudio-sdk
+    #   uvicorn
 colorlog==6.9.0
     # via
     #   paddlex (../../../setup.py)
@@ -78,6 +84,7 @@ fastapi==0.115.8
 filelock==3.17.0
     # via
     #   huggingface-hub
+    #   modelscope
     #   paddlex (../../../setup.py)
 filetype==1.2.0
     # via paddlex (../../../setup.py)
@@ -172,6 +179,8 @@ matplotlib==3.5.2
     # via
     #   paddlex (../../../setup.py)
     #   pycocotools
+modelscope==1.29.0
+    # via paddlex (../../../setup.py)
 more-itertools==10.6.0
     # via cssutils
 multidict==6.1.0
@@ -243,7 +252,9 @@ pillow==9.5.0
 premailer==3.10.0
     # via paddlex (../../../setup.py)
 prettytable==3.14.0
-    # via paddlex (../../../setup.py)
+    # via
+    #   aistudio-sdk
+    #   paddlex (../../../setup.py)
 propcache==0.3.0
     # via
     #   aiohttp
@@ -297,10 +308,12 @@ regex==2024.11.6
     #   tiktoken
 requests==2.32.3
     # via
+    #   aistudio-sdk
     #   huggingface-hub
     #   langchain
     #   langchain-community
     #   langsmith
+    #   modelscope
     #   paddlex (../../../setup.py)
     #   premailer
     #   requests-toolbelt
@@ -358,7 +371,9 @@ tokenizers==0.19.1
     # via paddlex (../../../setup.py)
 tqdm==4.67.1
     # via
+    #   aistudio-sdk
     #   huggingface-hub
+    #   modelscope
     #   openai
     #   paddlex (../../../setup.py)
 typing-extensions==4.12.2
@@ -383,7 +398,9 @@ typing-inspect==0.9.0
 ujson==5.10.0
     # via paddlex (../../../setup.py)
 urllib3==2.3.0
-    # via requests
+    # via
+    #   modelscope
+    #   requests
 uvicorn==0.34.0
     # via paddlex (../../../setup.py)
 wcwidth==0.2.13
@@ -394,3 +411,7 @@ yarl==1.18.3
     # via
     #   aiohttp
     #   paddlex (../../../setup.py)
+
+# The following packages are considered to be unsafe in a requirements file:
+setuptools==80.9.0
+    # via modelscope

+ 25 - 4
deploy/hps/server_env/requirements/gpu.txt

@@ -13,6 +13,8 @@ aiohttp==3.11.12
     #   paddlex (../../../setup.py)
 aiosignal==1.3.2
     # via aiohttp
+aistudio-sdk==0.3.5
+    # via paddlex (../../../setup.py)
 annotated-types==0.7.0
     # via pydantic
 anyio==4.8.0
@@ -27,7 +29,9 @@ async-timeout==4.0.3
 attrs==25.1.0
     # via aiohttp
 bce-python-sdk==0.9.42
-    # via paddlex (../../../setup.py)
+    # via
+    #   aistudio-sdk
+    #   paddlex (../../../setup.py)
 beautifulsoup4==4.13.4
     # via paddlex (../../../setup.py)
 cachetools==5.5.2
@@ -46,7 +50,9 @@ charset-normalizer==3.4.1
 chinese-calendar==1.10.0
     # via paddlex (../../../setup.py)
 click==8.2.1
-    # via uvicorn
+    # via
+    #   aistudio-sdk
+    #   uvicorn
 colorlog==6.9.0
     # via
     #   paddlex (../../../setup.py)
@@ -78,6 +84,7 @@ fastapi==0.116.1
 filelock==3.17.0
     # via
     #   huggingface-hub
+    #   modelscope
     #   paddlex (../../../setup.py)
 filetype==1.2.0
     # via paddlex (../../../setup.py)
@@ -172,6 +179,8 @@ matplotlib==3.5.2
     # via
     #   paddlex (../../../setup.py)
     #   pycocotools
+modelscope==1.29.0
+    # via paddlex (../../../setup.py)
 more-itertools==10.6.0
     # via cssutils
 multidict==6.1.0
@@ -243,7 +252,9 @@ pillow==9.5.0
 premailer==3.10.0
     # via paddlex (../../../setup.py)
 prettytable==3.14.0
-    # via paddlex (../../../setup.py)
+    # via
+    #   aistudio-sdk
+    #   paddlex (../../../setup.py)
 propcache==0.3.0
     # via
     #   aiohttp
@@ -297,10 +308,12 @@ regex==2024.11.6
     #   tiktoken
 requests==2.32.3
     # via
+    #   aistudio-sdk
     #   huggingface-hub
     #   langchain
     #   langchain-community
     #   langsmith
+    #   modelscope
     #   paddlex (../../../setup.py)
     #   premailer
     #   requests-toolbelt
@@ -358,7 +371,9 @@ tokenizers==0.19.1
     # via paddlex (../../../setup.py)
 tqdm==4.67.1
     # via
+    #   aistudio-sdk
     #   huggingface-hub
+    #   modelscope
     #   openai
     #   paddlex (../../../setup.py)
 typing-extensions==4.12.2
@@ -384,7 +399,9 @@ typing-inspect==0.9.0
 ujson==5.10.0
     # via paddlex (../../../setup.py)
 urllib3==2.3.0
-    # via requests
+    # via
+    #   modelscope
+    #   requests
 uvicorn==0.35.0
     # via paddlex (../../../setup.py)
 wcwidth==0.2.13
@@ -395,3 +412,7 @@ yarl==1.18.3
     # via
     #   aiohttp
     #   paddlex (../../../setup.py)
+
+# The following packages are considered to be unsafe in a requirements file:
+setuptools==80.9.0
+    # via modelscope

+ 1 - 1
deploy/hps/server_env/scripts/remove_images.sh

@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-paddlex_version="$(cat ../../paddlex/.version)"
+paddlex_version="$(cat ../../../paddlex/.version)"
 
 for device_type in 'gpu' 'cpu'; do
     version="$(cat "${device_type}_version.txt")"

+ 1 - 1
deploy/hps/server_env/scripts/tag_and_push_images.sh

@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-paddlex_version="$(cat ../../paddlex/.version)"
+paddlex_version="$(cat ../../../paddlex/.version)"
 
 for device_type in 'gpu' 'cpu'; do
     version="$(cat "${device_type}_version.txt")"