Skip to content

Commit 35dac29

Browse files
authored
Fix docs (#1380)
1 parent 34ec333 commit 35dac29

File tree

9 files changed

+50
-44
lines changed

9 files changed

+50
-44
lines changed

docs/source/LLM/支持的模型和数据集.md

Lines changed: 22 additions & 21 deletions
Large diffs are not rendered by default.

docs/source/Multi-Modal/glm4v最佳实践.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
## 环境准备
1212
```shell
13+
# 请使用"ms-swift>=2.2"或者main分支
1314
git clone https://github.com/modelscope/swift.git
1415
cd swift
1516
pip install -e '.[llm]'

docs/source/Multi-Modal/minicpm-v-2.5最佳实践.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
## 环境准备
1212
```shell
13+
# 请使用"ms-swift>=2.2"或者main分支.
1314
git clone https://github.com/modelscope/swift.git
1415
cd swift
1516
pip install -e '.[llm]'

docs/source/Multi-Modal/minicpm-v-2最佳实践.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
## 环境准备
1212
```shell
13+
# 请使用"ms-swift>=2.2"或者main分支.
1314
git clone https://github.com/modelscope/swift.git
1415
cd swift
1516
pip install -e '.[llm]'

docs/source/Multi-Modal/minicpm-v最佳实践.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
## 环境准备
1313
```shell
14+
# 请使用"ms-swift>=2.2"或者main分支.
1415
pip install 'ms-swift[llm]' -U
1516
```
1617

docs/source_en/LLM/Supported-models-datasets.md

Lines changed: 22 additions & 21 deletions
Large diffs are not rendered by default.

docs/source_en/Multi-Modal/glm4v-best-practice.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
## Environment Setup
1111
```shell
12+
# Please use 'ms-swift>=2.2' or the main branch.
1213
git clone https://github.com/modelscope/swift.git
1314
cd swift
1415
pip install -e '.[llm]'

docs/source_en/Multi-Modal/minicpm-v-best-practice.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Using minicpm-v-3b-chat as an example, if you want to use the updated version of
99

1010
## Environment Setup
1111
```shell
12+
# Please use 'ms-swift>=2.2' or the main branch.
1213
pip install 'ms-swift[llm]' -U
1314
```
1415

swift/llm/utils/template.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,6 @@ def encode(self, example: Dict[str, Any]) -> Tuple[Dict[str, Any], Dict[str, Any
10531053

10541054
def data_collator(self, batch: List[Dict[str, Any]], padding_to: Optional[int] = None) -> Dict[str, Any]:
10551055
res = super().data_collator(batch, padding_to)
1056-
pad_len = res['labels'].shape[1] - res['input_ids'].shape[1]
1057-
res['attention_mask'] = F.pad(res['attention_mask'], (pad_len, 0), 'constant', 1)
10581056
images = [b['images'] for b in batch if 'images' in b]
10591057
if images:
10601058
res['images'] = torch.concat(images)

0 commit comments

Comments
 (0)