Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang committed Feb 4, 2025
1 parent c1d3210 commit 78eed13
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 165 deletions.
16 changes: 1 addition & 15 deletions docs/source/Instruction/命令行参数.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,8 @@ Vera使用`target_modules`, `target_regex`, `modules_to_save`三个参数.
- check_model: 检查本地模型文件有损坏或修改并给出提示,默认为True。如果是断网环境,请设置为False
- 🔥create_checkpoint_symlink: 额外创建checkpoint软链接,方便书写自动化训练脚本。best_model和last_model的软链接路径分别为f'{output_dir}/best'和f'{output_dir}/last'
- loss_type: loss类型。默认为None,使用模型自带损失函数

- packing: 是否使用序列packing,默认为False
- 🔥lazy_tokenize: 是否使用lazy_tokenize。若该参数设置为False,则在训练之前对所有的数据集样本进行tokenize(多模态模型则包括从磁盘中读取图片)。该参数在LLM训练中默认设置为False,而MLLM训练默认为True,节约内存

- acc_strategy: 训练和验证时计算acc的策略。可选为`seq``token`级别的acc,默认为`token`
- max_new_tokens: 覆盖生成参数。predict_with_generate=True时的最大生成token数量,默认64
- temperature: 覆盖生成参数。predict_with_generate=True时的temperature,默认0
Expand All @@ -325,16 +323,11 @@ RLHF参数继承于[训练参数](#训练参数)
- ref_model: 采用dpo、kto、ppo算法且使用全参数训练时需要传入。默认为None
- ref_model_type: 同model_type。默认为None
- ref_model_revision: 同model_revision。默认为None

- 🔥beta: KL正则项系数,默认为`None`,即`simpo`算法默认为`2.`,其他算法默认为`0.1`。具体参考[文档](./人类对齐.md)
- label_smoothing: 是否使用DPO smoothing,默认值为`0`

- 🔥rpo_alpha: 控制DPO中加入sft_loss的权重,默认为`1`。最后的loss为`KL_loss + rpo_alpha * sft_loss`

- cpo_alpha: CPO/SimPO loss 中 nll loss的系数, 默认为`1.`

- simpo_gamma: SimPO算法中的reward margin项,论文建议设置为0.5-1.5,默认为`1.`

- desirable_weight: KTO算法中对desirable response的loss权重 $\lambda_D$,默认为`1.`
- undesirable_weight: KTO算法中对undesirable response的loss权重 $\lambda_U$,默认为`1.`

Expand Down Expand Up @@ -379,7 +372,6 @@ RLHF参数继承于[训练参数](#训练参数)
- host: 服务host,默认为'0.0.0.0'
- port: 端口号,默认为8000
- api_key: 访问需要使用的api_key,默认为None

- owned_by: 默认为`swift`
- 🔥served_model_name: 提供服务的模型名称,默认使用model的后缀
- verbose: 打印详细日志,默认为True
Expand Down Expand Up @@ -422,13 +414,11 @@ App参数继承于[部署参数](#部署参数), [Web-UI参数](#Web-UI参数)

- 🔥output_dir: 导出结果存储路径。默认为None,会自动设置合适后缀的路径
- exist_ok: 如果output_dir存在,不抛出异常,进行覆盖。默认为False

- 🔥quant_method: 可选为'gptq'、'awq'、'bnb',默认为None。例子参考[这里](https://github.com/modelscope/ms-swift/tree/main/examples/export/quantize)
- quant_n_samples: gptq/awq的校验集采样数,默认为256
- max_length: 校准集的max_length, 默认值2048
- quant_batch_size: 量化batch_size,默认为1
- group_size: 量化group大小,默认为128

- 🔥push_to_hub: 是否推送hub,默认为False。例子参考[这里](https://github.com/modelscope/ms-swift/blob/main/examples/export/push_to_hub.sh)
- hub_model_id: 推送的model_id,默认为None
- hub_private_repo: 是否是private repo,默认为False
Expand All @@ -438,7 +428,6 @@ App参数继承于[部署参数](#部署参数), [Web-UI参数](#Web-UI参数)

- prm_model: 过程奖励模型的类型,可以是模型id(以pt方式拉起),或者plugin中定义的prm key(自定义推理过程)
- orm_model: 结果奖励模型的类型,通常是通配符或测试用例等,一般定义在plugin中

- sampler_type:采样类型,目前支持sample(do_sample方式),未来会支持mcts和dvts
- sampler_engine:支持`pt`, `lmdeploy`, `vllm`, `no`,默认为`pt`,采样模型的推理引擎
- output_dir:输出目录,默认为`sample_output`
Expand All @@ -448,16 +437,13 @@ App参数继承于[部署参数](#部署参数), [Web-UI参数](#Web-UI参数)
- num_sampling_per_gpu_batches:共采样多少batch
- n_best_to_keep:返回多少最佳sequences
- data_range:本采样处理数据集的分片。传入格式为`2 3`,代表数据集分为3份处理(这意味着通常有三个`swift sample`在并行处理),本实例正在处理第3个分片

- temperature:在这里默认为1.0
- prm_threshold:PRM阈值,低于该阈值的结果会被过滤掉,默认值为`0`
- easy_query_threshold:单个query的所有采样中,ORM评估如果正确,大于该比例的query会被丢弃,防止过于简单的query出现在结果中,默认为`None`,代表不过滤

- engine_kwargs:传入sampler_engine的额外参数,以json string传入,例如`{"cache_max_entry_count":0.7}`

- num_return_sequences:采样返回的原始sequence数量。默认为64,本参数对`sample`采样有效
- cache_files:为避免同时加载prm和generator造成显存OOM,可以分两步进行采样,第一步将prm和orm置为`None`,则所有结果都会输出到文件中,第二次运行采样将sampler_engine置为`no`并传入`--cache_files`为上次采样的输出文件,则会使用上次输出的结果进行prm和orm评估并输出最终结果。
- 注意:使用cache_files时,--dataset仍然需要传入,这是因为cache_files的id是由原始数据计算的md5,需要把两部分信息结合使用。
- 注意:使用cache_files时,`--dataset`仍然需要传入,这是因为cache_files的id是由原始数据计算的md5,需要把两部分信息结合使用。


## 特定模型参数
Expand Down
Loading

0 comments on commit 78eed13

Please sign in to comment.