Skip to content

Commit 3914e1d

Browse files
authored
Support self cognition (#188)
1 parent 6ed3081 commit 3914e1d

28 files changed

+751
-148
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
## 📖 Table of Contents
2323
- [Introduction](#-introduction)
2424
- [News](#-news)
25-
- [LLM Training and Inference Example](#-llm-training-and-inference-example)
25+
- [LLM Training and Inference](#-llm-training-and-inference)
2626
- [Installation](#-installation)
2727
- [Getting Started](#-getting-started)
2828
- [Learn More](#-learn-more)
@@ -57,6 +57,7 @@ Users can check the [documentation of SWIFT](docs/source/GetStarted/快速使用
5757

5858

5959
## 🎉 News
60+
- 🔥 2023.12.2: [Best Practices for Self-cognition Fine-tuning](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自我认知微调最佳实践.md), **10 minutes for self-cognition fine-tuning for LLM**, creating a LLM that is specific to oneself.
6061
- 🔥 2023.11.30: Support for training and inference of the **qwen-1_8b**, **qwen-72b**, and **qwen-audio** model series. The corresponding shell scripts can be viewed at [qwen_1_8b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_1_8b_chat), [qwen_72b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_72b_chat), [qwen_audio_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_audio_chat).
6162
- 🔥 2023.11.29: Support the training and inference for AnimateDiff
6263
- 🔥 2023.11.24: Support for **yi-34b-chat**, **codefuse-codellama-34b-chat**: The corresponding shell script can be found in [yi_34b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/yi_34b_chat), [codefuse_codellama_34b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/codefuse_codellama_34b_chat).
@@ -84,13 +85,14 @@ Users can check the [documentation of SWIFT](docs/source/GetStarted/快速使用
8485
- 2023.9.3: Supported **baichuan2** model series: baichuan2-7b, baichuan2-7b-chat, baichuan2-13b, baichuan2-13b-chat.
8586

8687

87-
## ✨ LLM Training and Inference Example
88+
## ✨ LLM Training and Inference
8889
### Simple Usage
89-
- Quickly perform inference on LLM, see the [LLM Inference Documentation](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM推理文档.md).
90-
- Rapidly fine-tune and perform inference on LLM, and build a Web-UI. See the [LLM Fine-tuning Documentation](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM微调文档.md).
90+
- [Must Read] **Self-cognitionfine-tuning** for large models in **10 minutes**, creating a personalized large model, please refer to [Best Practices for Self-cognition Fine-tuning](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自我认知微调最佳实践.md).
91+
- Quickly perform **inference** on LLM and build a **Web-UI**, see the [LLM Inference Documentation](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM推理文档.md).
92+
- Rapidly **fine-tune** and perform inference on LLM, and build a Web-UI. See the [LLM Fine-tuning Documentation](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM微调文档.md).
9193
- View the models and datasets supported by Swift. You can check [supported models and datasets](https://github.com/modelscope/swift/blob/main/docs/source/LLM/支持的模型和数据集.md).
9294
- Expand and customize models, datasets, and dialogue templates in Swift, see [Customization and Expansion](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md).
93-
- Check command-line hyperparameters for fine-tuning and inference, see [Command-Line Hyperparameters](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行超参数.md)
95+
- Check command-line parameters for fine-tuning and inference, see [Command-Line parameters](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行参数.md).
9496

9597

9698
### Features

README_CN.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
## 📖 目录
2323
- [简介](#-简介)
2424
- [新闻](#-新闻)
25-
- [大模型训练推理的例子](#-大模型训练推理的例子)
25+
- [大模型训练推理](#-大模型训练推理)
2626
- [安装](#-安装)
2727
- [快速开始](#-快速开始)
2828
- [了解更多](#-了解更多)
@@ -54,8 +54,8 @@ SWIFT(Scalable lightWeight Infrastructure for Fine-Tuning)是一个可扩展
5454

5555
用户可以查看 [SWIFT官方文档](docs/source/GetStarted/快速使用.md) 来了解详细信息。
5656

57-
5857
## 🎉 新闻
58+
- 🔥 2023.12.2: [自我认知微调最佳实践](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自我认知微调最佳实践.md), **10分钟对大模型进行自我认知微调**, 创建专属于自己的大模型.
5959
- 🔥 2023.11.30: 支持**qwen-1_8b**, **qwen-72b**, **qwen-audio**系列模型的训练的推理. 对应的sh脚本可以查看[qwen_1_8b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_1_8b_chat), [qwen_72b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_72b_chat), [qwen_audio_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/qwen_audio_chat)
6060
- 🔥 2023.11.29: 支持AnimateDiff的训练和推理
6161
- 🔥 2023.11.24: 支持**yi-34b-chat**, **codefuse-codellama-34b-chat**模型. 对应的sh脚本可以查看[yi_34b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/yi_34b_chat), [codefuse_codellama_34b_chat](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts/codefuse_codellama_34b_chat).
@@ -83,13 +83,14 @@ SWIFT(Scalable lightWeight Infrastructure for Fine-Tuning)是一个可扩展
8383
- 2023.9.3: 支持**baichuan2**系列模型: baichuan2-7b, baichuan2-7b-chat, baichuan2-13b, baichuan2-13b-chat.
8484

8585

86-
## 大模型训练推理的例子
86+
## 大模型训练推理
8787
### 简单使用
88-
- 快速对LLM进行推理, 可以查看[LLM推理文档](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM推理文档.md).
89-
- 快速对LLM进行微调, 推理并搭建Web-UI. 可以查看[LLM微调文档](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM微调文档.md).
88+
- 【必读】**10分钟**对大模型进行**自我认知微调**, 创建专属于自己的大模型, 可以查看[自我认知微调最佳实践](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自我认知微调最佳实践.md).
89+
- 快速对LLM进行**推理**, 搭建**Web-UI**, 可以查看[LLM推理文档](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM推理文档.md).
90+
- 快速对LLM进行**微调**, 推理并搭建Web-UI. 可以查看[LLM微调文档](https://github.com/modelscope/swift/blob/main/docs/source/LLM/LLM微调文档.md).
9091
- 查看swift支持的模型和数据集. 可以查看[支持的模型和数据集](https://github.com/modelscope/swift/blob/main/docs/source/LLM/支持的模型和数据集.md).
91-
- 对swift中的模型, 数据集, 对话模板进行拓展, 可以查看[自定义与拓展](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md).
92-
- 查询微调和推理的命令行超参数, 可以[命令行超参数](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行超参数.md)
92+
- 对swift中的模型, 数据集, 对话模板进行**拓展**, 可以查看[自定义与拓展](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md).
93+
- 查询微调和推理的命令行参数, 可以[命令行参数](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行参数.md).
9394

9495

9596
### 特性

docs/source/LLM/LLM微调文档.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# LLM微调文档
2+
## 目录
3+
- [环境准备](#环境准备)
4+
- [微调](#微调)
5+
- [Merge LoRA](#merge-lora)
6+
- [推理](#推理)
7+
- [Web-UI](#web-ui)
8+
29
## 环境准备
310
GPU设备: A10, 3090, V100, A100均可.
411
```bash
@@ -15,7 +22,7 @@ pip install deepspeed -U
1522
# 如果你想要使用基于auto_gptq的qlora训练. (推荐, 效果优于bnb)
1623
# 支持auto_gptq的模型: `https://github.com/modelscope/swift/blob/main/docs/source/LLM/支持的模型和数据集.md#模型`
1724
# auto_gptq和cuda版本有对应关系,请按照`https://github.com/PanQiWei/AutoGPTQ#quick-installation`选择版本
18-
pip install auto_gptq
25+
pip install auto_gptq -U
1926

2027
# 如果你想要使用基于bnb的qlora训练.
2128
pip install bitsandbytes -U
@@ -28,17 +35,17 @@ pip install -r requirements/llm.txt -U
2835
## 微调
2936
### 使用python
3037
```python
31-
# Experimental environment: A10, 3090, A100, ...
38+
# Experimental environment: A10, 3090, V100, ...
3239
# 20GB GPU memory
3340
import os
3441
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
3542

3643
import torch
3744

3845
from swift.llm import (
39-
DatasetName, InferArguments, ModelType, SftArguments
46+
DatasetName, InferArguments, ModelType, SftArguments,
47+
infer_main, sft_main, web_ui_main, merge_lora_main
4048
)
41-
from swift.llm.run import infer_main, sft_main, web_ui_main
4249

4350
model_type = ModelType.qwen_7b_chat
4451
sft_args = SftArguments(
@@ -54,6 +61,7 @@ torch.cuda.empty_cache()
5461
infer_args = InferArguments(
5562
ckpt_dir=best_model_checkpoint,
5663
show_dataset_sample=10)
64+
# merge_lora_main(infer_args)
5765
result = infer_main(infer_args)
5866
torch.cuda.empty_cache()
5967

@@ -62,7 +70,7 @@ web_ui_main(infer_args)
6270

6371
### 使用CLI
6472
```bash
65-
# Experimental environment: A10, 3090, A100, ...
73+
# Experimental environment: A10, 3090, V100, ...
6674
# 20GB GPU memory
6775
CUDA_VISIBLE_DEVICES=0 \
6876
swift sft \
@@ -111,7 +119,7 @@ cd examples/pytorch/llm
111119
- 如果你使用的是**V100**等较老的GPU, 你需要设置`--dtype AUTO`或者`--dtype fp16`, 因为其不支持bf16.
112120
- 如果你的机器是A100等高性能显卡, 且使用的是qwen系列模型, 推荐你安装[**flash-attn**](https://github.com/Dao-AILab/flash-attention), 这将会加快训练和推理的速度以及显存占用(A10, 3090, V100等显卡不支持flash-attn进行训练). 支持flash-attn的模型可以查看[LLM支持的模型](https://github.com/modelscope/swift/blob/main/docs/source/LLM/支持的模型和数据集.md#模型)
113121
- 如果你要进行**二次预训练**, **多轮对话**, 你可以参考[自定义与拓展](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md#注册数据集的方式)
114-
- 如果你需要断网进行训练, 请使用`--model_cache_dir`和设置`--check_model_is_latest false`. 具体参数含义请查看[命令行超参数](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行超参数.md).
122+
- 如果你需要断网进行训练, 请使用`--model_cache_dir`和设置`--check_model_is_latest false`. 具体参数含义请查看[命令行参数](https://github.com/modelscope/swift/blob/main/docs/source/LLM/命令行参数.md).
115123
- 如果你想在训练时, 将权重push到ModelScope Hub中, 你需要设置`--push_to_hub true`.
116124
- 如何你想要在推理时, 合并LoRA权重并保存,你需要设置`--merge_lora_and_save true`. **不推荐对qlora训练的模型进行merge**, 这会存在精度损失.
117125
- 以下提供了可以直接运行的`qwen_7b_chat`的sh脚本(你只需要在推理时指定`--ckpt_dir`即可顺利执行). 更多模型的scripts脚本, 可以查看[scripts文件夹](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm/scripts). 如果你想要**自定义sh脚本**, 推荐你参考`scripts/qwen_7b_chat`中的脚本进行书写.
@@ -184,6 +192,12 @@ bash scripts/qwen_7b_chat/qlora_ddp_ds/sft.sh
184192
bash scripts/qwen_7b_chat/qlora_ddp_ds/infer.sh
185193
```
186194

195+
## Merge LoRA
196+
提示: **暂时**不支持bnb和auto_gptq量化模型的merge lora.
197+
```bash
198+
swift merge-lora --ckpt_dir 'xxx/vx_xxx/checkpoint-xxx'
199+
```
200+
187201
## 推理
188202
### 原始模型
189203
**单样本推理**可以查看[LLM推理文档](./LLM推理文档.md#-推理)
@@ -244,20 +258,23 @@ print(f'response: {response}')
244258
print(f'history: {history}')
245259
```
246260

247-
使用**数据集**评估
261+
使用**数据集**评估:
248262
```bash
263+
# 直接推理
249264
CUDA_VISIBLE_DEVICES=0 swift infer --ckpt_dir 'xxx/vx_xxx/checkpoint-xxx'
250265

251-
# merge LoRA增量权重并推理
266+
# Merge LoRA增量权重并推理
252267
swift merge-lora --ckpt_dir 'xxx/vx_xxx/checkpoint-xxx'
253268
CUDA_VISIBLE_DEVICES=0 swift infer --ckpt_dir 'xxx/vx_xxx/checkpoint-xxx-merged'
254269
```
255270

256271
## Web-UI
272+
### 原始模型
257273
使用原始模型的web-ui可以查看[LLM推理文档](./LLM推理文档.md#-Web-UI)
258274

259-
微调后模型的web-ui:
275+
### 微调后模型
260276
```bash
277+
# 直接使用web-ui
261278
CUDA_VISIBLE_DEVICES=0 swift web-ui --ckpt_dir 'xxx/vx_xxx/checkpoint-xxx'
262279

263280
# merge LoRA增量权重并使用web-ui

docs/source/LLM/LLM推理文档.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# LLM推理文档
2+
## 目录
3+
- [环境准备](#环境准备)
4+
- [推理](#推理)
5+
- [Web-UI](#web-ui)
6+
27
## 环境准备
38
GPU设备: A10, 3090, V100, A100均可.
49
```bash
@@ -12,7 +17,7 @@ pip install -e .[llm]
1217
# 如果你想要使用基于auto_gptq的模型进行推理.
1318
# 使用auto_gptq的模型: `https://github.com/modelscope/swift/blob/main/docs/source/LLM/支持的模型和数据集.md#模型`
1419
# auto_gptq和cuda版本有对应关系,请按照`https://github.com/PanQiWei/AutoGPTQ#quick-installation`选择版本
15-
pip install auto_gptq
20+
pip install auto_gptq -U
1621

1722
# 环境对齐 (如果你运行错误, 可以跑下面的代码, 仓库使用最新环境测试)
1823
pip install -r requirements/framework.txt -U
@@ -335,7 +340,7 @@ history: [('浙江的省会在哪里?', '浙江的省会是杭州。'), ('这
335340
```
336341

337342

338-
### 量化
343+
### bnb量化
339344
```python
340345
import os
341346
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
@@ -390,48 +395,45 @@ history: [('浙江的省会在哪里?', '浙江的省会是杭州。'), ('这
390395
```
391396
## Web-UI
392397
### qwen-7b-chat
393-
使用CLI
398+
使用CLI:
394399
```bash
395400
CUDA_VISIBLE_DEVICES=0 swift web-ui --model_id_or_path qwen/Qwen-7B-Chat
396401
```
397402

398-
使用python
403+
使用python:
399404
```python
400405
import os
401406
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
402407

403-
from swift.llm.run import web_ui_main
404-
from swift.llm import InferArguments, ModelType
408+
from swift.llm import InferArguments, ModelType, web_ui_main
405409

406410
infer_args = InferArguments(model_type=ModelType.qwen_7b_chat)
407411
web_ui_main(infer_args)
408412
```
409413

410-
使用量化
414+
使用bnb量化:
411415
```python
412416
import os
413417
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
414418

415-
from swift.llm.run import web_ui_main
416-
from swift.llm import InferArguments, ModelType
419+
from swift.llm import InferArguments, ModelType, web_ui_main
417420

418421
infer_args = InferArguments(model_type=ModelType.qwen_7b_chat, quantization_bit=4)
419422
web_ui_main(infer_args)
420423
```
421424

422425
### qwen-7b
423-
使用CLI
426+
使用CLI:
424427
```bash
425428
swift web-ui --model_id_or_path qwen/Qwen-7B
426429
```
427430

428-
使用python
431+
使用python:
429432
```python
430433
import os
431434
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
432435

433-
from swift.llm.run import web_ui_main
434-
from swift.llm import InferArguments, ModelType
436+
from swift.llm import InferArguments, ModelType, web_ui_main
435437

436438
infer_args = InferArguments(model_type=ModelType.qwen_7b)
437439
web_ui_main(infer_args)

docs/source/LLM/命令行超参数.md renamed to docs/source/LLM/命令行参数.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# 命令行超参数
1+
# 命令行参数
2+
## 目录
3+
- [sft.sh 命令行参数](#sft.sh-命令行参数)
4+
- [infer.sh 命令行参数](#infer.sh-命令行参数)
5+
26
## sft.sh 命令行参数
37
- `--model_type`: 表示你选择的模型类型, 默认是`None`. 如果没有指定`model_id_or_path`, 则抛出异常. 如果指定了`model_id_or_path`, 则会根据`model_id_or_path`以及`MODEL_MAPPING`推断`model_type`. `model_type``model_id_or_path`这两个参数不能同时指定. 可以选择的`model_type`可以查看`MODEL_MAPPING.keys()`.
48
- `--model_id_or_path`: 表示模型在ModelScope Hub中的`model_id`, 不区分大小写, 默认为`None`. 如果`--model_id_or_path`未被注册, 则会抛出异常. 你可以使用`model_type`的方式指定模型类型, 也可以通过`model_id_or_path`的方式指定模型类型.
@@ -20,14 +24,18 @@
2024
- `--val_dataset_sample`: 对验证集进行采样, 默认是`None`. 如果你指定为`-1`, 则使用完整的验证集进行验证.
2125
- `--system`: 对话模板中使用的system, 默认为`None`, 即使用模型默认的system.
2226
- `--max_length`: token的最大长度, 默认为`2048`. 可以避免个别过长的数据样本造成OOM的问题. 如果某数据样本长度超过max_length, 我们会切除最前面的token: `input_ids[-max_length:]`. 如果设置为-1, 则无限制.
27+
- `--truncation_strategy`: 默认是`'delete'`表示把超过max_length的句子从数据集中删除. `'truncation_left'`表示会将超过文本的左边给切除掉, 这可能会切到special token, 会影响性能, 并不推荐.
2328
- `--check_dataset_strategy`: 默认值为`'none'`, 即不做检查. 如果你训练的模型是LLM, 则推荐使用`'warning'`作为数据检查的策略. 如果你的训练目标为句子分类等任务, 则建议设置为'`none`'.
2429
- `--custom_train_dataset_path`: 默认值为`None`. 具体的含义参考[Customization and Expansion](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md).
2530
- `--custom_val_dataset_path`: 默认值为`None`. 具体的含义参考[Customization and Expansion](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自定义与拓展.md).
31+
- `--self_cognition_sample`: 自我认知数据集的采样数. 默认为`0`. 你该值设置为>0时, 需要同时指定`--model_name`, `--model_author`. 如果你想了解更多, 可以查看[自我认知微调最佳实践](https://github.com/modelscope/swift/blob/main/docs/source/LLM/自我认知微调最佳实践.md).
32+
- `--model_name`: 默认为`None`. 如果开启了自我认知数据集的采样(即self_cognition_sample>0), 你需要传入两个值, 分别代表模型的中文名和英文名. 例如: `--model_name 小黄 'Xiao Huang'`.
33+
- `--model_author`: 默认为`None`. 如果开启了自我认知数据集的采样, 你需要传入两个值, 分别代表作者的中文名和英文名. 例如: `--model_author 魔搭 ModelScope`.
2634
- `--quantization_bit`: 用于指定是否进行量化和量化的bit数, 默认为`0`, 即不进行量化. 如果要使用4bit qlora, 你需要设置`--sft_type lora --quantization_bit 4`
2735
- `--bnb_4bit_comp_dtype`: 在进行4bit量化时, 我们需要在模型的forward和backward时, 将其进行反量化. 该参数用于指定反量化后的torch_dtype. 默认为`'AUTO'`, 即与`dtype`保持一致. 可选择的值包括: 'fp16', 'bf16', 'fp32'. 当quantization_bit为0时, 该参数无效.
2836
- `--bnb_4bit_quant_type`: 4bit量化时的量化方式, 默认是`'nf4'`. 可选择的值包括: 'nf4', 'fp4'. 当quantization_bit为0时, 该参数无效.
2937
- `--bnb_4bit_use_double_quant`: 是否在4bit量化时开启double量化, 默认为`True`. 当quantization_bit为0时, 该参数无效.
30-
- `--lora_target_modules`: 指定lora模块, 默认为`None`. 如果lora_target_modules为None, 或者传入`'DEFAULT'`, 则根据`model_type`查找`MODEL_MAPPING`中的`lora_target_modules`(默认指定为qkv). 如果传入`ALL`, 则将所有的Linear层都指定为lora模块(不含head). 该参数只有当`sft_type`指定为'lora'时才生效.
38+
- `--lora_target_modules`: 指定lora模块, 默认为`None`. 如果lora_target_modules为None, 或者传入`'DEFAULT'` or `'AUTO'`, 则根据`model_type`查找`MODEL_MAPPING`中的`lora_target_modules`(默认指定为qkv). 如果传入`ALL`, 则将所有的Linear层都指定为lora模块(不含head). 该参数只有当`sft_type`指定为'lora'时才生效.
3139
- `--lora_rank`: 默认为`8`. 只有当`sft_type`指定为'lora'时才生效.
3240
- `--lora_alpha`: 默认为`32`. 只有当`sft_type`指定为'lora'时才生效.
3341
- `--lora_dropout_p`: 默认为`0.05`, 只有当`sft_type`指定为'lora'时才生效.
@@ -87,6 +95,7 @@
8795
- `--val_dataset_sample`: 表示想要评估和展示的验证集的数量, 默认值为`10`. 该参数只有在`eval_human`设置为False时才生效.
8896
- `--system`: 默认值为`None`. 具体的参数介绍可以在`sft.sh命令行参数`中查看.
8997
- `--max_length`: 默认值为`2048`. 具体的参数介绍可以在`sft.sh命令行参数`中查看.
98+
- `--truncation_strategy`: 默认是`'delete'`. 具体的参数介绍可以在`sft.sh命令行参数`中查看.
9099
- `--check_dataset_strategy`: 默认值为`'none'`, 具体的参数介绍可以在`sft.sh命令行参数`中查看.
91100
- `--custom_train_dataset_path`: 默认值为`None`. 具体的含义参考README.md中的`自定义数据集`模块.
92101
- `--custom_val_dataset_path`: 默认值为`None`. 具体的含义参考README.md中的`自定义数据集`模块.

0 commit comments

Comments
 (0)