Skip to content

Commit aa36829

Browse files
committed
[bugfix] Fix qwen3 coder template (#6409)
1 parent ac92c66 commit aa36829

File tree

11 files changed

+42
-39
lines changed

11 files changed

+42
-39
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ Running Environment:
127127
|--------------|--------------|---------------------|-------------------------------------------|
128128
| python | >=3.9 | 3.10/3.11 | |
129129
| cuda | | cuda12 | No need to install if using CPU, NPU, MPS |
130-
| torch | >=2.0 | 2.7.1 | |
131-
| transformers | >=4.33 | 4.56.2 | |
130+
| torch | >=2.0 | 2.8.0 | |
131+
| transformers | >=4.33 | 4.57.1 | |
132132
| modelscope | >=1.23 | | |
133133
| peft | >=0.11,<0.18 | | |
134134
| flash_attn | | 2.8.1/3.0.0b1 | |
135-
| trl | >=0.15,<0.24 | 0.20.0 | RLHF |
136-
| deepspeed | >=0.14 | 0.17.5 | Training |
137-
| vllm | >=0.5.1 | 0.10.1.1 | Inference/Deployment |
138-
| sglang | >=0.4.6 | 0.4.10.post2 | Inference/Deployment |
139-
| lmdeploy | >=0.5 | 0.9.2.post1 | Inference/Deployment |
135+
| trl | >=0.15,<0.24 | 0.23.1 | RLHF |
136+
| deepspeed | >=0.14 | 0.17.6 | Training |
137+
| vllm | >=0.5.1 | 0.11.0 | Inference/Deployment |
138+
| sglang | >=0.4.6 | 0.5.4.post2 | Inference/Deployment |
139+
| lmdeploy | >=0.5 | 0.10.2 | Inference/Deployment |
140140
| evalscope | >=1.0 | | Evaluation |
141141
| gradio | | 5.32.1 | Web-UI/App |
142142

README_CN.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ pip install -e .
123123
|--------------|--------------|---------------------|--------------------|
124124
| python | >=3.9 | 3.10/3.11 | |
125125
| cuda | | cuda12 | 使用cpu、npu、mps则无需安装 |
126-
| torch | >=2.0 | 2.7.1 | |
127-
| transformers | >=4.33 | 4.56.2 | |
126+
| torch | >=2.0 | 2.8.0 | |
127+
| transformers | >=4.33 | 4.57.1 | |
128128
| modelscope | >=1.23 | | |
129129
| peft | >=0.11,<0.18 | | |
130130
| flash_attn | | 2.8.1/3.0.0b1 | |
131-
| trl | >=0.15,<0.24 | 0.20.0 | RLHF |
132-
| deepspeed | >=0.14 | 0.17.5 | 训练 |
133-
| vllm | >=0.5.1 | 0.10.1.1 | 推理/部署 |
134-
| sglang | >=0.4.6 | 0.4.10.post2 | 推理/部署 |
135-
| lmdeploy | >=0.5 | 0.9.2.post1 | 推理/部署 |
131+
| trl | >=0.15,<0.24 | 0.23.1 | RLHF |
132+
| deepspeed | >=0.14 | 0.17.6 | 训练 |
133+
| vllm | >=0.5.1 | 0.11.0 | 推理/部署 |
134+
| sglang | >=0.4.6 | 0.5.4.post2 | 推理/部署 |
135+
| lmdeploy | >=0.5 | 0.10.2 | 推理/部署 |
136136
| evalscope | >=1.0 | | 评测 |
137137
| gradio | | 5.32.1 | Web-UI/App |
138138

docs/source/BestPractices/Qwen3-VL最佳实践.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Overall, this is a sweet, lighthearted video that showcases the innocence and im
168168

169169
Qwen3-VL的bbox输出采用归一化1000的相对坐标。你可以使用 ms-swift 提供的 grounding 数据集格式,其中"bbox"中的坐标为绝对坐标,ms-swift 会自动将绝对坐标转为归一化1000的相对坐标。更多信息请参考[grounding数据集格式文档](../Customization/自定义数据集.md#grounding)
170170
```jsonl
171-
{"messages": [{"role": "user", "content": "<image>找到图像中的<ref-object>"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["", "", ""], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
171+
{"messages": [{"role": "user", "content": "<image>找到图像中的<ref-object>"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"},\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["", "", ""], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
172172
```
173173

174174
### Dense模型

docs/source/Customization/自定义数据集.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ alpaca格式:
223223

224224
对于Qwen2.5-VL/Qwen3-VL,你可以使用环境`QWENVL_BBOX_FORMAT='new'`(默认为'legacy',需"ms-swift>=3.9.1"),以兼容[官方cookbook](https://github.com/QwenLM/Qwen3-VL/blob/main/cookbooks/2d_grounding.ipynb)格式。并将数据集定义成以下格式:
225225
```jsonl
226-
{"messages": [{"role": "user", "content": "<image>找到图像中的<ref-object>"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["", "", ""], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
226+
{"messages": [{"role": "user", "content": "<image>找到图像中的<ref-object>"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"},\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["", "", ""], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
227227
```
228228

229229
测试ms-swift格式的grounding数据格式的最终格式:

docs/source/GetStarted/SWIFT安装.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ modelscope-registry.us-west-1.cr.aliyuncs.com/modelscope-repo/modelscope:ubuntu2
103103
|--------------|--------------|---------------------|--------------------|
104104
| python | >=3.9 | 3.10/3.11 | |
105105
| cuda | | cuda12 | 使用cpu、npu、mps则无需安装 |
106-
| torch | >=2.0 | 2.7.1 | |
107-
| transformers | >=4.33 | 4.56.2 | |
106+
| torch | >=2.0 | 2.8.0 | |
107+
| transformers | >=4.33 | 4.57.1 | |
108108
| modelscope | >=1.23 | | |
109109
| peft | >=0.11,<0.18 | | |
110110
| flash_attn | | 2.8.1/3.0.0b1 | |
111-
| trl | >=0.15,<0.24 | 0.20.0 | RLHF |
112-
| deepspeed | >=0.14 | 0.17.5 | 训练 |
113-
| vllm | >=0.5.1 | 0.10.1.1 | 推理/部署 |
114-
| sglang | >=0.4.6 | 0.4.10.post2 | 推理/部署 |
115-
| lmdeploy | >=0.5 | 0.9.2.post1 | 推理/部署 |
111+
| trl | >=0.15,<0.24 | 0.23.1 | RLHF |
112+
| deepspeed | >=0.14 | 0.17.6 | 训练 |
113+
| vllm | >=0.5.1 | 0.11.0 | 推理/部署 |
114+
| sglang | >=0.4.6 | 0.5.4.post2 | 推理/部署 |
115+
| lmdeploy | >=0.5 | 0.10.2 | 推理/部署 |
116116
| evalscope | >=1.0 | | 评测 |
117117
| gradio | | 5.32.1 | Web-UI/App |
118118

docs/source/Megatron-SWIFT/快速开始.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ modelscope-registry.us-west-1.cr.aliyuncs.com/modelscope-repo/modelscope:ubuntu2
6262
|--------------|--------------|-------------|--------------------|
6363
| python | >=3.9 | 3.10/3.11 | |
6464
| cuda | | cuda12 | |
65-
| torch | >=2.0 | 2.6.0/2.7.1 | |
65+
| torch | >=2.0 | 2.7.1/2.8.0 | |
6666
| transformer_engine | >=2.3 | | |
6767
| apex | | 0.1 | |
68-
| megatron_core | >=0.12 | 0.13 | |
68+
| megatron_core | | 0.13 | |
6969
| flash_attn | | 2.8.1/3.0.0b1 | |
70-
| transformers | >=4.33 | 4.56.2 | |
70+
| transformers | >=4.33 | 4.57.1 | |
7171
| modelscope | >=1.23 | | |
7272
| peft | >=0.11,<0.18 | | LoRA |
7373
| trl | >=0.15,<0.24 | | RLHF |

docs/source_en/BestPractices/Qwen3-VL-Best-Practice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ If you need to fine-tune the model with a custom dataset, you can prepare the da
167167
Qwen3-VL's bbox output uses normalized 1000 relative coordinates. You can use the grounding dataset format provided by ms-swift, where the coordinates in "bbox" are absolute coordinates, and ms-swift will automatically convert absolute coordinates to normalized 1000 relative coordinates. For more information, please refer to the [Grounding Dataset Format Documentation](../Customization/Custom-dataset.md#grounding).
168168

169169
```jsonl
170-
{"messages": [{"role": "user", "content": "<image>Locate the <ref-object> in the image"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["sheep", "sheep", "sheep"], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
170+
{"messages": [{"role": "user", "content": "<image>Locate the <ref-object> in the image"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"},\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["sheep", "sheep", "sheep"], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
171171
```
172172

173173
### Dense Models

docs/source_en/Customization/Custom-dataset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ The format will automatically convert the dataset format to the corresponding mo
238238

239239
For Qwen2.5-VL/Qwen3-VL, you can set the environment variable `QWENVL_BBOX_FORMAT='new'` (default is `'legacy'`, requires "ms-swift>=3.9.1") to be compatible with the [official cookbook](https://github.com/QwenLM/Qwen3-VL/blob/main/cookbooks/2d_grounding.ipynb) format. Define your dataset in the following format:
240240
```jsonl
241-
{"messages": [{"role": "user", "content": "<image>Locate the <ref-object> in the image"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["sheep", "sheep", "sheep"], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
241+
{"messages": [{"role": "user", "content": "<image>Locate the <ref-object> in the image"}, {"role": "assistant", "content": "[\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"},\n\t{\"bbox_2d\": <bbox>, \"label\": \"<ref-object>\"}\n]"}], "images": ["cat.png"], "objects": {"ref": ["sheep", "sheep", "sheep"], "bbox": [[90.9, 160.8, 135, 212.8], [360.9, 480.8, 495, 532.8]]}}
242242
```
243243

244244
Testing the final format of the grounding data in ms-swift format:

docs/source_en/GetStarted/SWIFT-installation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ More images can be found [here](https://modelscope.cn/docs/intro/environment-set
104104
|--------------|--------------|---------------------|-------------------------------------------|
105105
| python | >=3.9 | 3.10/3.11 | |
106106
| cuda | | cuda12 | No need to install if using CPU, NPU, MPS |
107-
| torch | >=2.0 | 2.7.1 | |
108-
| transformers | >=4.33 | 4.56.2 | |
107+
| torch | >=2.0 | 2.8.0 | |
108+
| transformers | >=4.33 | 4.57.1 | |
109109
| modelscope | >=1.23 | | |
110110
| peft | >=0.11,<0.18 | | |
111111
| flash_attn | | 2.8.1 /3.0.0b1 | |
112-
| trl | >=0.15,<0.24 | 0.20.0 | RLHF |
113-
| deepspeed | >=0.14 | 0.17.5 | Training |
114-
| vllm | >=0.5.1 | 0.10.1.1 | Inference/Deployment |
115-
| sglang | >=0.4.6 | 0.4.10.post2 | Inference/Deployment |
116-
| lmdeploy | >=0.5 | 0.9.2.post1 | Inference/Deployment |
112+
| trl | >=0.15,<0.24 | 0.23.1 | RLHF |
113+
| deepspeed | >=0.14 | 0.17.6 | Training |
114+
| vllm | >=0.5.1 | 0.11.0 | Inference/Deployment |
115+
| sglang | >=0.4.6 | 0.5.4.post2 | Inference/Deployment |
116+
| lmdeploy | >=0.5 | 0.10.2 | Inference/Deployment |
117117
| evalscope | >=1.0 | | Evaluation |
118118
| gradio | | 5.32.1 | Web-UI/App |
119119

docs/source_en/Megatron-SWIFT/Quick-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ Recommended Operating Environment:
6262
|--------------|--------------|-------------|--------------------|
6363
| python | >=3.9 | 3.10/3.11 | |
6464
| cuda | | cuda12 | |
65-
| torch | >=2.0 | 2.6.0/2.7.1 | |
65+
| torch | >=2.0 | 2.7.1/2.8.0 | |
6666
| transformer_engine | >=2.3 | | |
6767
| apex | | 0.1 | |
68-
| megatron_core | >=0.12 | 0.13 | |
68+
| megatron_core | | 0.13 | |
6969
| flash_attn | | 2.8.1/3.0.0b1 | |
70-
| transformers | >=4.33 | 4.56.2 | |
70+
| transformers | >=4.33 | 4.57.1 | |
7171
| modelscope | >=1.23 | | |
7272
| peft | >=0.11,<0.18 | | LoRA |
7373
| trl | >=0.15,<0.24 | | RLHF |

0 commit comments

Comments
 (0)