Skip to content

Commit c2312fd

Browse files
committed
[infer] update lmdeploy version (#5398)
1 parent ba77548 commit c2312fd

File tree

7 files changed

+10
-6
lines changed

7 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Running Environment:
131131
| deepspeed | >=0.14 | 0.16.9 | Training |
132132
| vllm | >=0.5.1 | 0.10 | Inference/Deployment |
133133
| sglang | >=0.4.6 | 0.4.9.post6 | Inference/Deployment |
134-
| lmdeploy | >=0.5,<0.9 | 0.8 | Inference/Deployment |
134+
| lmdeploy | >=0.5 | 0.9.2 | Inference/Deployment |
135135
| evalscope | >=0.11 | | Evaluation |
136136
| gradio | | 5.32.1 | Web-UI/App |
137137

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pip install -e .
127127
| deepspeed | >=0.14 | 0.16.9 | 训练 |
128128
| vllm | >=0.5.1 | 0.10 | 推理/部署 |
129129
| sglang | >=0.4.6 | 0.4.9.post6 | 推理/部署 |
130-
| lmdeploy | >=0.5,<0.9 | 0.8 | 推理/部署 |
130+
| lmdeploy | >=0.5 | 0.9.2 | 推理/部署 |
131131
| evalscope | >=0.11 | | 评测 |
132132
| gradio | | 5.32.1 | Web-UI/App |
133133

docs/source/GetStarted/SWIFT安装.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ modelscope-registry.us-west-1.cr.aliyuncs.com/modelscope-repo/modelscope:ubuntu2
9696
| deepspeed | >=0.14 | 0.16.9 | 训练 |
9797
| vllm | >=0.5.1 | 0.10 | 推理/部署 |
9898
| sglang | >=0.4.6 | 0.4.9.post6 | 推理/部署 |
99-
| lmdeploy | >=0.5,<0.9 | 0.8 | 推理/部署 |
99+
| lmdeploy | >=0.5 | 0.9.2 | 推理/部署 |
100100
| evalscope | >=0.11 | | 评测 |
101101
| gradio | | 5.32.1 | Web-UI/App |
102102

docs/source_en/GetStarted/SWIFT-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ More images can be found [here](https://modelscope.cn/docs/intro/environment-set
9797
| deepspeed | >=0.14 | 0.16.9 | Training |
9898
| vllm | >=0.5.1 | 0.10 | Inference/Deployment |
9999
| sglang | >=0.4.6 | 0.4.9.post6 | Inference/Deployment |
100-
| lmdeploy | >=0.5,<0.9 | 0.8 | Inference/Deployment |
100+
| lmdeploy | >=0.5 | 0.9.2 | Inference/Deployment |
101101
| evalscope | >=0.11 | | Evaluation |
102102
| gradio | | 5.32.1 | Web-UI/App |
103103

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
# test env: lmdeploy 0.9.2
12
NPROC_PER_NODE=4 \
23
CUDA_VISIBLE_DEVICES=0,1,2,3 \
34
swift infer \
45
--model Qwen/Qwen2.5-1.5B-Instruct \
56
--infer_backend lmdeploy \
67
--val_dataset AI-ModelScope/alpaca-gpt4-data-zh#1000 \
7-
--max_batch_size 16 \
88
--max_new_tokens 512

requirements/install_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# sh requirements/install_all.sh
33
pip install "sglang[all]" -U
44
pip install "vllm>=0.5.1" "transformers<4.55" "trl<0.21" -U
5-
pip install "lmdeploy>=0.5,<0.9" -U --no-deps
5+
pip install "lmdeploy>=0.5" -U
66
pip install autoawq -U --no-deps
77
pip install auto_gptq optimum bitsandbytes "gradio<5.33" -U
88
pip install git+https://github.com/modelscope/ms-swift.git

swift/llm/infer/infer_engine/lmdeploy_engine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from lmdeploy.serve import async_engine
1515
from packaging import version
1616
from transformers import GenerationConfig
17+
from transformers.utils.versions import require_version
1718

1819
from swift.llm import InferRequest, Template, TemplateMeta, get_model_tokenizer
1920
from swift.plugin import Metric
@@ -105,6 +106,9 @@ def _prepare_engine_kwargs(self,
105106
pipeline_kwargs = {}
106107
is_multimodal = self.model_meta.is_multimodal
107108
if is_multimodal:
109+
require_version(
110+
'lmdeploy<0.9', 'LmdeployEngine will no longer maintain inference for '
111+
'multimodal models in lmdeploy>=0.9.')
108112
vision_config = VisionConfig(max_batch_size=vision_batch_size)
109113
pipeline_kwargs['vision_config'] = vision_config
110114
logger.info(f'vision_config: {vision_config}')

0 commit comments

Comments
 (0)